Disable command button based on date conditions?

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
 
F

fredg

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top