I was given this code back in May and it worked fine for me. I lost my database that I tested this event on and now I'm trying to rebuild the event on a new test database, but its not working for me now.
The only difference I am doing today is changing (date)=6 to
(date)=3. Assuming '3' is for Wednesday - so I can test it today.
Here is the help I received from AJN2004. I know the code works, but for some reason I can't get it to work for me today. This is a copy of the message from May.
**********************************************
Add the folowing code to the "On open" section in the properties dialog of your start form:
CODE
Private Sub Form_Open(Cancel As Integer)
If Weekday(Date) = 6 Then
MsgBox "Sorry the database is down today for maintenance." _
& "Please try again on Monday", vbOKOnly + vbInformation, "Database down"
DoCmd.Quit
End If
End Sub
if the day is 6 (Friday) a messag box appears informing the user that he/she cannot use the databse and closes the program.
*******************************************************
I open the properties box on my startup form and added the code to the "On Open" event for the form.
Does anyone having any ideas as to what I'm doing wrong?
Much thanks.
Kat
The only difference I am doing today is changing (date)=6 to
(date)=3. Assuming '3' is for Wednesday - so I can test it today.
Here is the help I received from AJN2004. I know the code works, but for some reason I can't get it to work for me today. This is a copy of the message from May.
**********************************************
Add the folowing code to the "On open" section in the properties dialog of your start form:
CODE
Private Sub Form_Open(Cancel As Integer)
If Weekday(Date) = 6 Then
MsgBox "Sorry the database is down today for maintenance." _
& "Please try again on Monday", vbOKOnly + vbInformation, "Database down"
DoCmd.Quit
End If
End Sub
if the day is 6 (Friday) a messag box appears informing the user that he/she cannot use the databse and closes the program.
*******************************************************
I open the properties box on my startup form and added the code to the "On Open" event for the form.
Does anyone having any ideas as to what I'm doing wrong?
Much thanks.
Kat