Link to home
Start Free TrialLog in
Avatar of swimehdi
swimehdiFlag for United States of America

asked on

If Statement Access Query

Hello Expert,

I am trying to develop an if statement for my form in VBA:  

If Query "XYZ" is open then DoCmd.CloseQuery "XYZ"

Not sure if possible. I appreciate your help.
SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sorry, it was a  typo error on my part..
Avatar of swimehdi

ASKER

The VBA wording that worked for me is:

DoCmd.Close acQuery, "XYZ"
 
and NOT

 DoCmd.CloseQuery "XYZ"

Expert's suggestion helped.