Avatar of Ernest Grogg
Ernest Grogg
 asked on

IIF statement in SQL, .isvisible then

Hello,

Is there are way to check for visibility on a control before running the criteria:

IIF Forms!myfrm!drivers.visible THEN Forms!myfrm!myfield
Microsoft AccessVBASQL

Avatar of undefined
Last Comment
Ernest Grogg

8/22/2022 - Mon
SOLUTION
Dale Fye

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

IF Forms!myfrm!drivers.visible = True THEN Forms!myfrm!myfield <SomeThingHere>
Ernest Grogg

ASKER
On my subform I have it set up running on a sql statement that will save the data based on the main form, but one of the controls are visible and not visible based on the criteria on the main form.  So I set the sql statement to qry the data based on the main form.  

So if the one control is not visible then I want the data not to do the criteria for that control and vice versa....if the control is visible then run the criteria for the control..
ASKER CERTIFIED SOLUTION
PatHartman

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ernest Grogg

ASKER
Ok, so doesn't look good, so i changed the format of the main form to show an ID field after the controls were updated and selected, then I am running the sql criteria on subform.
Your help has saved me hundreds of hours of internet surfing.
fblack61