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

fill in listbox

Status
Not open for further replies.

phpatrick

Programmer
Jul 9, 2006
72
BE
Hé,

Situation:
Main Form : Adresse
Subform : Contact

In the head of my form I wan't a listbox, listing the Contacts.
Problem : It seems I could only fill in the listbox with fields available in the main form, but I like to have al the contacts of my subform or the contacttable.

The second action is after selection to filter a contact in the subform. I would try this with something like this

Docmd.FindRecord lstBox.Column(0)
Or Me.SubForm.Form.Filter = lstBox.Column(0)
Me.SubForm.Form.FilterOn = True

txks, pat
 
Have you tried a combobox, rather than a listbox? The wizard will guide you through creating a box that will do what you want.
 
ok, I used a SQL statement to fill in the listbox, now I look to select the subform.
 
correct, it is a combobox (drop down list with choise)
 
Ok. So for the second bit, you want a filter yesno? You mention column(0) above, let us say that this column has a numeric ContactID. You would then put in the After Update event:
[tt]Me.[SubForm Control Name].Form.Filter = "ContactID=" & Me.cboCombo.Column(0)
Me.[SubForm Control Name].Form.FilterOn = True[/tt]

Alternatively, you may wish to set the Link Child and Link master fields for the subform to take account of the combo.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top