Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking if keyfield is empty or null, please help!!

Status
Not open for further replies.

Jar80

Technical User
Jun 13, 2004
69
FI
I have two forms which contains next information:
Form 1 is mainmenu and it contains button named button1, Form 2 contains keyfield and some other fields that are not important.

What i want is that when i open the form 1 then it opens form 2 and go to the keyfield and check if this is empty or null then if it´s empty or null then form1 button1.enabled=false else button1.enabled=true.

Now i done that form 1 open event i have opened form 2 and i have tryied to use if else clause but i haven´t got it work.
 
Hi

"What i want is that when i open the form 1 then it opens form 2 and go to the keyfield and check if this is empty or null then if it´s empty or null then form1 button1.enabled=false else button1.enabled=true."

Assuming Form1 is still open

in the On Open event of Form2 put

If Len(Trim(Nz(MyKeyField,"")&"")) = 0 Then
Forms!Form1!Button1.Visible = False
Else
Forms!Form1!Button1.Visible = True
End If

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top