G
Guest
Hi all,
I have a form close button that when clicked will run a check. This will
run a SQL Select query, that I would like the result to determine how an
If/Else will be ran. For example, if their is a result in the query, I would
like it run 'A', else, if there is no result, then 'B' will run (resulting in
nothing happening). How would I set this up in VBA? I am not sure how to
use the result from the SQL to determine which option will be used. I am
thinking it would be something like:
DoCmd.RunSQL "SELECT..."
If result = yes then
'A'
elseif result = no then
'B'
endif
How would I set this up? Do I need to have the result post to a variable? I
need syntax help, thanks
-gary
I have a form close button that when clicked will run a check. This will
run a SQL Select query, that I would like the result to determine how an
If/Else will be ran. For example, if their is a result in the query, I would
like it run 'A', else, if there is no result, then 'B' will run (resulting in
nothing happening). How would I set this up in VBA? I am not sure how to
use the result from the SQL to determine which option will be used. I am
thinking it would be something like:
DoCmd.RunSQL "SELECT..."
If result = yes then
'A'
elseif result = no then
'B'
endif
How would I set this up? Do I need to have the result post to a variable? I
need syntax help, thanks
-gary