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

Help linking text box with a combo box 1

Status
Not open for further replies.

mmckeel

Technical User
Jul 11, 2001
7
US
I am trying to use a combo box to set the criteria for what appears is a text box. I have 2 table one called tblEMC and one called tblDP.

tblEMC tblDP
EMCID DPID
EMCName EMCID
DPName
Directions
Address

In my form I have 2 combo boxes where combo2 is dependant on combo1. What I am trying to do is to take the data from tblDP.Address and tblDP.Directions and input them into the forms's text boxes (address and directions) based on the selection of combo2. Any help would greatly be appreciated.

Thanks
MMcKeel
 
Not sure I follow exactly
But you can force a form to get new data from a acombo box in its "after update" event

Me!Recordsource = "Select from your Table where somefield = " Combo1.text

Or you can change a second combo to get date from the first combo box

Private Sub Combo0_AfterUpdate()
Combo2.Requery '<<<<<<<<< just this line
End Sub

put this in the Combo2's Control Source In the Properties Window
SELECT DISTINCTROW ContactsID, CompanyID, FirstName, LastName FROM Contacts WHERE (((CompanyID)=[Forms]![Form2]![Combo0]));

Hope this Helps


DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
let's see if I can clear things up. I have a combo box for the EMC and based on that I can select the DPName from the second combo box. Each DPname has a distinct address and set of directions. All I want is for a text box called address to display the address of the DPname when it is selected from the combo box called DPName.

 
MmcKeel,

Try using ComboBoxName.Column(3) as the ControlSource for your Address textbox. Replace ComboBoxName with the name of your combobox.

Hope this helps.;-) Who takes 7 seconds to develop,
7 mins to document,
7 hours to test,
7 months to fix will always blame the clock. s-)
 
I am trying to get access to store a value in a text box that has been populated from three differnt fields, one being a combo box.
1.I have a date field
2.a time field
3.and a combo box with product details.
4.I have managed to combine the three field values into another text field called title, creating a unique name but every time I change records the text box details change.

What I would like to know is , how can I store the value from the combined fields into the title field so that is is stored for later reference
Hope this makes sense!
Thanks in advance
Phil Worrall
Manchester UK NHS Trusts
 
I am trying to do the same exact thing, if you find out, please e-mail me! lyonmt@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top