PDA

View Full Version : Open a form filtering on 2 fields



paulked
08-19-2009, 03:12 PM
Hi all.

I'm new to Access and am having difficulty filtering on two fields together before opening a form.

I have multiple recipes for various boats to be moulded in any of three ovens and in different colours. So, for example, I need to select 'Oven 1' and boat 'Dragon' (the 2nd and 3rd fields in the query) and bring up those recipes with the different colours available.

I have tried using 2 combo boxes and a select button in a form but it doesn't give me the correct records from the table.

Any ideas?

Many thanks

Paul Ked

OBP
08-20-2009, 03:30 AM
Paul, you can either set the Form's "Filter" using VBA SQL to what you want, or if you want a separate "Search" form with a couple of Combos you can use the Query's Criteria Row with
Forms![formname]![fieldname]
see Randy's explanation here
http://www.vbaexpress.com/forum/showthread.php?t=28062
and here
http://www.vbaexpress.com/forum/showthread.php?t=27549

You may need to use put the Combo selection in to an unbound field to make it work though.

paulked
08-20-2009, 09:23 AM
Many thanks.

I'll give it a bash (if I can get my head round it!!)

Cheers

Paul Ked