If statement

  • Thread starter Thread starter dale
  • Start date Start date
D

dale

Is there a way in a query to have an if statement that will allow me to
do one section of code versus the other based on some value. Something
like below

if (value = true)
run query1 based on form1
else
run query2 based on form2
 
No. That requires VBA code (or lots of futzing around with a macro's
Condition column.)
 
Is there a way in a query to have an if statement that will allow me to do one
section of code versus the other based on some value. Something like below

if (value = true)
run query1 based on form1
else
run query2 based on form2

A form is based on a query, not the other way around.
When you open a form the query upon which it's based runs
automatically.

Put it in code:

If value = True Then
DoCmd.OpenForm "form1"
Else
DoCmd OpenForm "form2"
End If

Tom Lake
 
Back
Top