Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get a Text box to automatically enter data based on a combo 1

Status
Not open for further replies.

jonvblazen

Technical User
Jun 20, 2001
6
US
I have a Combo box that when selected, I want a corresponding field from a table to fill in with the option to change it. How would I go about doing this?
 
you need to make yourself clearer if you want someone to answer
 
I'm sorry about that...long night...

I have a table that has questions and its answers. So then there is a main form that contains a combo box with a drop down of Questions. Right next to it, I have a text box that I will like to fill in with it's corresponding answers from the table. However, If a user feels that the answer isn't what they were looking for...they have the option of typing in their own answer. Any help regarding this issue is greatly appreciated. Thanks in advance!
 
I'm sorry about that...

I have a table that has questions and its answers. So then there is a main form that contains a combo box with a drop down of Questions. Right next to it, I have a text box that I will like to fill in with it's corresponding answers from the table. However, If a user feels that the answer isn't what they were looking for...they have the option of typing in their own answer. Any help regarding this issue is greatly appreciated. Thanks in advance!
 
2. From what I can make out There are two tables involved. Here's a few steps

as an example
The first table Questions contains

QuestionID
Question
AnswerSuggestion


and the second table Results stores

AnswerID
QuestionID
Answer


1. create a form based on results table.
2. Add textbox for answer id,
3. Add a combo for QuestionID, select look up values in a
table... select all fields, and when you come to the
part where you set column widths, drag across the width
of answer so that it's hidden.

4. Add textbox for Answer (call it Answer)

5. Select combo box, and in the properties list, go down to
the bottom where the events are located.

6. select After_update and build code.

enter

Me.Answer = Me.Combo2.Column(2)

simple.

just make sure that you have the proper number of the column in the combo box ( they start at 0,1,2)
 
Hi. What if I have a form based on a query? I tried your method and nothing happens in the text boxes I was hoping would autofill.

I have a combo box with a list (Architectural_Firm). I have a telephone (Arch_Telephone) and a fax (Arch_Facsimile) text box. I would each of them to autofill when the User chooses the Architect from the combo box.

I have tried at least four different methods, based on the wonderful responses in this forum, but none have worked. I will preface by saying that my text box name and caption name are the same. Does this matter. Oh, and the telephone numbers are masked to be phone numbers.

Please help. :)

Dianne in Virginia
 
I'd go with Pflangan's dual table design and then create a form/subform combo. Make the subform your answers. You can then manipulate the subform to display all the answers associated with the question and also allow users to add and answer.

By enforcing referential integretity between the tables you can delete all the answers if a question is no longer valid and you need to delete the question.

Cheers.
 
#pflangan> what if I have already had a macro in the After_update field? The macro I put is for requery, so that the following combo box can hav filtered data based on the first combo box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top