Filtering a form through a combo box

rick roberts

Registered User.
Local time
Today, 22:41
Joined
Jan 22, 2003
Messages
160
i realise this is an old question but ive read through so many answers but fail to make it work
i have a form with a selection of textboxes, one in particular named 'Featuring' which contains peoples names
i also have an unbound combo box called 'cmbFeaturing' containing a list of names
my intention is to choose a name from the combo box and filter the form to show only the records relavant to that name
from the threads ive gathered that the cod i need should be either

Me.Form.Filter = "Featuring = " & cmbFeaturing or
DoCmd.OpenForm , , , "Featuring =" & cmdFeaturing

neither of these work since i get a Syntax Error (missing operator) in query or expression 'Featuring = HERE IT ACTUALLY CALLS THE NAME FROM THE COMBO' error or it brings up one blank record
 
the code you offered brings up the same syntax error
my combo box has a row source of
SELECT DISTINCT tblMain.Featuring FROM tblMain ORDER BY Featuring;
and is bound to column 1 it is not set to any particular format
 
unfortunately the third video stops half way through
i do have this program working already using a query and a duplicate form ie i click a button that opens an identical form but relating to a query that filters out all but the name in the combo box i just thought that there was a simpler way so i didnt have to create a query and extra form
after resolving my filter problem my intention was to create a combo box and button on all textboxes so that i can filter from any box (namely Location County Date etc..)
 

Users who are viewing this thread

Back
Top Bottom