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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fill text box with query result based on combo box data

Status
Not open for further replies.

drewson

MIS
Jun 3, 2003
50
0
0
US
I'm creating a database for an audio-visual services dept at a small university, and we're tracking equipment from room to room with the EquipHistory table. EquipInfo stores the data about each individual piece of equipment, and the two are related by SerialNum.

I want to put a combo box on a form that allows me to select the SerialNum (from EquipInfo), and then as soon as I select it, a text box displays the current location of the equipment (from EquipHistory). I've tried to set the Control Source of the text box to a query, but quickly realized that this isn't possible. Any ideas?
 
You can change the record source of a form to do what you want. Then make the text box bound to the field that shows where the piece of equipment is.

I would make a form with a subform and base the subform on the query with the combobox as the criteria ([forms]![yourform]![YourCboBox] OR [forms]![yourform]![YourCboBox] IS NULL)

If you need more help, let me know what you didn't understand and I will see what I can do.

Chris
 
Thanks for your help that works perfectly!
 
Create a query which has both tables in it. Then set the Record source of the form to the query, and set the combobox to the serial number of the equipment. Bind a textbox to the location field and it should work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top