extracting data from a table using IF statment

  • Thread starter Thread starter michael goodall
  • Start date Start date
M

michael goodall

i want to extract data from one record on a table using an IF
statement but i do not know how to go about it. the table i want to
extract the data from is not connected to any forms, it just the
result of a counting query. the rough layout of my if statement would
be - IF resultofquery = 1 then open form1 else open form2 . i
appreciate any assistance i will recieve from anyone. many thanks,
michael
 
i want to extract data from one record on a table using an IF
statement but i do not know how to go about it. the table i want to
extract the data from is not connected to any forms, it just the
result of a counting query. the rough layout of my if statement would
be - IF resultofquery = 1 then open form1 else open form2 . i
appreciate any assistance i will recieve from anyone. many thanks,
michael

Run the query and save the results to an invisible text field (or a
variable in VB if you'd prefer) on whatever form your executing from.


If Me.TextField = 1 Then
DoCmd.OpenForm "form1"
Else
DoCmd.OpenForm "form2"
EndIf
 

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