Combo Box to Filter Contacts based on Letter of the Alphabet

Pauline123

Registered User.
Local time
Today, 06:44
Joined
Apr 1, 2013
Messages
69
Hi, am trying to figure out how to set a filter via a combobox selection.

My subform contains a list of suppliers. I would like to select from a combobox a letter from the alphabet and filter the subform based on the first letter of the suppliers company name.

Does anyone have any ideas.
 
In the after update event of the combo:

Me.SubformName.Form.RecordSource = "SELECT Blah FROM TableName WHERE Company Like '" & Me.ComboName & "*'"
 
Does your subform already contain a complete list of suppliers that you'd like to filter or are you filling an empty listbox? And, I'm assuming your subform contains a listbox for the list?
 
Hi Paul - I have tried this and keep getting "Compile Error: Method or Data Member Not Found"

This is he code entered in the after update of the combo box:

Me.SupplierContactSub.Form.RecordSource = "SELECT SupplierName FROM qrySupplierContactList WHERE SupplierName Like '" & Me.ComboAlphabet & "*'"

My subform is called "SupplierContactSub" and its record source is a query "qrySupplierContactList".

Can you shed any light :-)
 
The combo is on the main form, right? Make sure that's the name of the subform control, if different than the subform itself.
 
Sorry my subform is called "SupContInsertForm"

The main form where the combo box is located is called "SupplierContactSub"
 
I'm confused, but you want the name of the subform control there. Can you attach the db here?
 
Like I said, you need the name of the subform:

Me.SupContInsertForm.Form.RecordSource =
 
Oh, and I deleted the master/child links plus the main form's record source since it wasn't used.
 
Hi Paul thank you so much for your help - that kinda did the trick - just created another problem so I think I need to go back to basics to see what I have done wrong. Thanks again :-)
 
No problem, post back if you're still having trouble (perhaps a new thread if the topic is different).
 

Users who are viewing this thread

Back
Top Bottom