Full Version: opening a form which matches two criteria
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
vinchie
hello..

i have this form, let's call it form1, then through a button in form1 I would like to open form2 but it should be filtered. to be filtered, it should match 2 criterias (2 values form form1). is this possible? thanks
schroep
DoCmd.OpenForm "form2",acNormal,,"field1='" & Me.nameofcontrol1 & "' And field2=" & Me.nameofcontrol2

This assumes that field1 is text (thus the single quotes around the value) and field2 is numeric (thus no quotes). Field1 and Field2 are names of fields in the table/query underlying form2.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.