Generating text?

jackie77

Jackie
Local time
Today, 23:41
Joined
Jul 18, 2007
Messages
85
Hi all:o

I have a form which helps to document faults found on various products etc, what I want to do to help save typing is when a user selects a company form the combo box, I want some text to automaically be placed in the text box below, however I most also bew able to edit this text to add more details

For example if the user selects the company 'Titan' from the combo box I want the text box to autogenerate the word 'Cracked oil tank' in the text box

or if the the user selects the company 'Basstil' the words 'Faulty W/man' appears

Can anyone suggest the code for this or how would I go about it, bearing in mind I an very new

Thanks as always for all your help

Jackie
 
you can try using case statements
and for each it would be
case 1:
me.yourboxyouwantthetextin="here is your text"
case 2:
etc...
 
Don't hard code those values. Create a table or modify an existing one to house the comments for each company and use a DLookup to pull the appropriate comment when you need it.
 
Thank you both for your reply, I have added on to my table these comments but I am not to sure how to go about using the Dlookup command?

Thanks again
Jackie
 
Do you have the company ID in the combo box? When they select the combo box, in the combo's After Update event you should be able to use:
Code:
Me.YourTextBoxToPutTheCommentsIn = DLookup("[YourCommentFieldNameHere]", "YourTableNameHere","[YourCompanyIDNumberFieldHere]=" & Me.YourComboBoxNameHere)
Make sure to use the quotation marks and square brackets in the same spots as I have and change the names to your object names.
 
Thats great, many many thanks, it works perfect exactly what I wanted it to do

Jackie
 

Users who are viewing this thread

Back
Top Bottom