Form from Qry that will set Enabled/Visible

khunter

Registered User.
Local time
Today, 21:49
Joined
Nov 23, 2003
Messages
25
I have a form that is based from a user input querie. I want it to check to see if the value that was entered by the user already exists in the table, then hide certain fields on the form before it opens.

Does anyone have a solid solution to this? I have tried to trap out the querie [Enter Value] and it does not seem to pass it to the form properly.

Something to the effect: IF tblTest.lngID Is NotNull
frmtest.label1 set enabled 0
else
frmtest.label1 set enabled 1


But I cannot seem to put it all together as I am a n00b.
 
You can use the openargs parameter on the DOCMD.Openforms command to pass the value the user entered.

Then in the open event for the form you can see if the value passed from the user exists in the table. If it does, you can then hide (or disable) the appropriate fields.
 

Users who are viewing this thread

Back
Top Bottom