If statement based on the Weekday function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to insert this code in a form "on open property":

If today's date is Saturday then
make "this button" visible
End If
 
Mario,
First, using the on open will cause the code to execute only once, so as you move from
record to record, the button will show/hide only once.
Use the form's Current event to check the date status each time you access a record,
and show/hide the button accordingly.

Also, if you are enetering the date value that keys the show/hide, you'll need to put
the same code in the AfterUpdate event of that date field.

See WeekDay Function in Help... (use your own fieldnames)

YourButtonName.Visible = WeekDay(YourDateFieldName) = 7
 
Thank you Al, it worked!

Al Camp said:
Mario,
First, using the on open will cause the code to execute only once, so as you move from
record to record, the button will show/hide only once.
Use the form's Current event to check the date status each time you access a record,
and show/hide the button accordingly.

Also, if you are enetering the date value that keys the show/hide, you'll need to put
the same code in the AfterUpdate event of that date field.

See WeekDay Function in Help... (use your own fieldnames)

YourButtonName.Visible = WeekDay(YourDateFieldName) = 7

--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
 

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

Back
Top