If Statement to Enable Button (1 Viewer)

Vespertin

Registered User.
Local time
Today, 10:53
Joined
May 8, 2011
Messages
11
hello everyone

can anyone advice on syntax for an If Statement.

I have a button on my form, to enable the button the user has to select a date in [txtBegDate] and click a tickbox [TickConfBox] when both these things are done, the button will be enabled?

Thanks for any help anyone can offer.

I'm using Access 2007
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 10:53
Joined
Aug 30, 2003
Messages
36,124
If IsDate(Me.txtBegDate) AND Me.TickConfBox = True Then

which can be simplified to

If IsDate(Me.txtBegDate) AND (Me.TickConfBox) Then

The code would likely go in the after update event of both controls, and probably the current event, so I'd probably make a form level function and call it from all 3.
 

Vespertin

Registered User.
Local time
Today, 10:53
Joined
May 8, 2011
Messages
11
Thanks paul - appreciate your help.

I understand the update event of each control and the forms current event - but I can call all 3 from a form level function - could you explain that a bit more?

Its just another area for me to research.
 

Users who are viewing this thread

Top Bottom