extracting data from a table using IF statment

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
 
R

requeth

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
 
Top