Disable command button based on date conditions?

  • Thread starter Thread starter crispywafers
  • Start date Start date
C

crispywafers

Hi,

I'm a newbie so pardon if this is a basic/dumb question. I have some
buttons on my form that I use to run update queries, etc. I would like
to disable them based on what time of year it is.

Example: Update December Invoices

Only allow this button to be enabled if the month is currently
November, December, January, Feb.

Can someone tell me what the code for this would be and what event I
would attach it to?

Thanks for your help,

Crispy
 
Hi,

I'm a newbie so pardon if this is a basic/dumb question. I have some
buttons on my form that I use to run update queries, etc. I would like
to disable them based on what time of year it is.

Example: Update December Invoices

Only allow this button to be enabled if the month is currently
November, December, January, Feb.

Can someone tell me what the code for this would be and what event I
would attach it to?

Thanks for your help,

Crispy

Perhaps something like this.
In the Form's Load event:

[CommandButtonName].Enabled = Month(Date()) > 10 and Month(Date())<3
 
Back
Top