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!

Open a form from a combo box

Status
Not open for further replies.

BillyL

IS-IT--Management
Jul 18, 2000
91
US
This may be basice but... How can I open a form and diplay a specific record that may be modified from a combo box selection? In other words, I want to click on a contact name in a combo box that appears in my Company form and have the contact record displayed in a separate form.
 
The row source of the combo box should have the unique ref (autonumber) as the first field, which you can hide by setting its column width to 0cm. The record source of the second form should have the same field, and you can then set the criteria to be based on the combo box i.e. [Forms]![FIRST FORM NAME]![UNIQUE REF]. Then just open the second form using the After Update event on the combo box.

If this doesn't make sense I can send you an example via e-mail of a similar form that I've used.
 
Thanks for the input dbapps. I would like the database you offered to send me so I can see it first-hand. That is very generous of you to offer. My email address is bt@beyondt.com.

Thanks.
 
Would you mind helping just a bit more. I want to capture the value of a Combo box to be used for later, for use in filters, or other items. Simple example:

Form name = frmSampleofCombo
Combo Box Name = Combo7

What is the VB reference to the value of the combo box selection.

Steve Marcum PT
Programmer
 
Steve,
You could save the combo selection in another table if you want to use it later.
Create a table with just the one field in it (Called ComboInfo). Add that table to the record source of the form that has the combo box on it and add ComboInfo from that table as a hidden text box on that form. In the After Update event for the combo box set Me!ComboInfo = Me!Combo7. That information will then be stored for later use. However it will be overwritten each time a new name is selected in Combo7.

Hope that helps.

Dave - London
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top