Open form with 2 criteria

  • Thread starter Thread starter Alan T
  • Start date Start date
A

Alan T

I need to open a form which need to satisfy 2 conditions.
I know how to specify 1 condition but no idea how to specify 2.
 
You can combine multiple conditions in the WhereCondition of OpenForm.

Essentially the WhereCondition has to end up like the WHERE clause of a
query, including the correct delimiters. This example shows how to use
criteria on a numeric field, a Text field, and a Date field:
Dim strWhere As String
strWhere = "(MyNumber = 1) AND (MyText = ""dog"") AND (MyDate =
#1/1/2007#")
DoCmd.OpenForm "Form1", WhereCondition:=strWhere
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top