Disable a command button until a field is populated

alfiwalf

Registered User.
Local time
Today, 04:38
Joined
Jul 23, 2014
Messages
11
Hi,

I am going round in circles here; I have a form which has certain text fields that need to be populated before a user can click a command button named 'Record Movement' that opens up another form. What I want to do is disable the 'Record Movement' button until these fields are populated. I am using Access 2010.

Regards,
 
Hi,

I am going round in circles here; I have a form which has certain text fields that need to be populated before a user can click a command button named 'Record Movement' that opens up another form. What I want to do is disable the 'Record Movement' button until these fields are populated. I am using Access 2010.

Regards,

Try This:-
 

Attachments

Hi Uncle Gizmo,

Many thanks for the prompt assistance.

Regards
 
Hi,

Worked a treat :D

I would like to take it one step further; I have three fields that I need populated before the command button becomes active. I noticed that with the code you sent me only one of these three fields needs to be populated before the command button becomes active.

What do I change in order to get the user to populate three of the fields before they can click the button please?

Regards
 
Hi,

With regards to my last post can you please give me some pointers; I would like the user to complete three text fields before the command button becomes active. If you could assist me it would be most appreciated.

Regards.
 
I noticed that with the code you sent me only one of these three fields needs to be populated before the command button becomes active.

No you are not correct. Please revisit the example and you will see.
 
Code:
 function validated as Boolean
 validated =   nz(ctrl1,"")<>"" and nz(ctrl2,"")<>""  and nz(ctrl3,"")<>"" then
 end function
in the afterupdate event for each of the controls, you can test this

Code:
 [B]if validated then[/B]
 [B]   whatever[/B]
 [B]end if[/B]
 

Users who are viewing this thread

Back
Top Bottom