Combo box to fill in text boxes

steven low

Registered User.
Local time
Today, 03:23
Joined
Dec 2, 2006
Messages
27
Hi guys

I want to use a combo to search for information.

At the moment I am trying to find out how to do this,

I have a combo box and three text boxes

and what I want to do is select the ID number in the combo box and once the number is select in the combo box the text boxes will also change depeneding on the text box.

I looked at the internet and there is no easy way of explaining this, I am looking for an easy way of doing this. Plzz help :(

Steve
 
Are you wanting the text box to display other fields from the record whose ID is selected by the combo?

If so:
Add the other fields to the combo's Row Source property and increase the number of Columns Count property to match. Set the Bound Column to the ID.
Set the Column Width of fields you don't want to show in the combo to zero.

Refer to the other columns in the combo as the Control Source of the textboxes.

=comboboxname.Column.x (where x is the column number starting at zero.)
 
Hi GalaxiomAtHome

Do you mean Control Source.

IS there a guide I could follow, it is very confusing!!!:confused:
 
Here's a quick sample DB that demonstrates the steps outlined in GalaxiomAtHome's post.

Look at the Row Source of the Combo, do this by clicking in the Row Source row of the Combo's Data Tab, and then clicking on the little button to the right of the row with the tree dots in it.

Now look at the Control Source for each of the Text boxes.

Do both of the above whilst the form is in Design View.
 

Attachments

Last edited:
Hi John

Sorry, it has been along time, I had to sit down and go through it again, I have tried it, and igt only appears to read column 1 only. Why is this?
I have tried column 2,3 and 4 and no luck

Is it because I have relations with the tables.
:confused:

help

I have attached my database so you can see the example I am trying to do

Steve
 

Attachments

If you want the info in one text box only you could use;
Code:
=Combo0.column(1) & " " & Combo0.column(2) & " " & Combo0.column(3) & " " & Combo0.column(4) & " " & Combo0.column(5) & " " & Combo0.column(6) & " " & Combo0.column(7)
as the Control Source for a text box.
 
Take a look at this updated version of your database.

I have fixed your form to work as you wanted. In this form you can see the data, you can change the data but the changes will not be written back to the database unless you add some code to make it happen.

I have created a new form where you can use the combo box to locate a record just like in the original form. However, with this new form you can also edit any record and it will be updated in the database.

Sorry John I did not realize that you were also making changes to the database. Oh, Well.
 
Last edited:
Hey, we covered the bases. I just thought the OP would like to see how to make the combo box work to actually retrieve the record.

Also, I just wanted you to know that it was truly not my intention to hi-jack the post. Thanks for the kind response.
 
Hi there

What I am confused about is not getting the information into the correct text boxes eg

text 1 = column 2
text 2 = column 3


For some reason I cant get this, I have followed what you have told me. I just want the Id number in the combo box and nothing else. :confused:

Please see the attachment I attached previously.

Steve
 
Last edited:
Did you look at the Form1 that is in the mdb file that I uploaded. The method for using this is in each of the text boxes on that form.
 
Is this what you are looking for?

What I've done is set the columns width of all columns except the first one to Zero.
 

Attachments

Users who are viewing this thread

Back
Top Bottom