S
steve1951
I have written and use a database to control a maintenance contract. I have
written a bit of code below to remind the user that a report needs to be
compiled.
Function Reminder()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "You need to submit the ASIPT Quarterly Return by the last working day
of this month! Do you wish to compile the report now?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 'Define buttons.
Title = "ASIPT Reminder" ' Define title.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbNo Then Call ReminderNo ' user chose no
If Response = vbYes Then Call ReminderYes ' User chose Yes.
End Function
Function ReminderYes()
DoCmd.OpenForm "ASIPT Return", acNormal, "", "", , acNormal
DoCmd.Maximize
End Function
Function ReminderNo()
DoCmd.OpenForm "Main menu", acNormal, "", "", , acNormal
DoCmd.Maximize
End Function
Function TestDate()
'Tests current date against the periods the reports are due,
'if it is the reminder function is run
If Now >= ("28 August") And Now <= ("3 September") Or Now >= ("28 November")
And Now <= ("3 December") Or Now >= ("26 February") And Now <= ("3 March") Or
Now >= ("28 May") And Now <= ("3 June") Then Call Reminder Else Call
ReminderNo
End Function
The function test date is called up from the autoexec macro and it all works
fine for all years!
I have been trying to not display the reminder if the report has been run.
The report is generated from vb and amongst other things it puts the Now
value into a table................... should I use Date() instead?
I have tried to use the function below to test the ReportDate but everything
goes pearshaped!!!
Function CheckDate()
Dim ReportDate As Date
ReportDate = Forms!ReportDate!ReportDate
If ReportDate >= ("28 August") And ReportDate <= ("3 September") Or
ReportDate >= ("28 November") And ReportDate <= ("3 December") Or ReportDate
End Function
Please has anyone got a neat idea for this????????????
Steve
written a bit of code below to remind the user that a report needs to be
compiled.
Function Reminder()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "You need to submit the ASIPT Quarterly Return by the last working day
of this month! Do you wish to compile the report now?" ' Define message.
Style = vbYesNo + vbCritical + vbDefaultButton2 'Define buttons.
Title = "ASIPT Reminder" ' Define title.
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbNo Then Call ReminderNo ' user chose no
If Response = vbYes Then Call ReminderYes ' User chose Yes.
End Function
Function ReminderYes()
DoCmd.OpenForm "ASIPT Return", acNormal, "", "", , acNormal
DoCmd.Maximize
End Function
Function ReminderNo()
DoCmd.OpenForm "Main menu", acNormal, "", "", , acNormal
DoCmd.Maximize
End Function
Function TestDate()
'Tests current date against the periods the reports are due,
'if it is the reminder function is run
If Now >= ("28 August") And Now <= ("3 September") Or Now >= ("28 November")
And Now <= ("3 December") Or Now >= ("26 February") And Now <= ("3 March") Or
Now >= ("28 May") And Now <= ("3 June") Then Call Reminder Else Call
ReminderNo
End Function
The function test date is called up from the autoexec macro and it all works
fine for all years!
I have been trying to not display the reminder if the report has been run.
The report is generated from vb and amongst other things it puts the Now
value into a table................... should I use Date() instead?
I have tried to use the function below to test the ReportDate but everything
goes pearshaped!!!
Function CheckDate()
Dim ReportDate As Date
ReportDate = Forms!ReportDate!ReportDate
If ReportDate >= ("28 August") And ReportDate <= ("3 September") Or
ReportDate >= ("28 November") And ReportDate <= ("3 December") Or ReportDate
And ReportDate <= ("3 June") Then Call ReminderNo Else Call Reminder= ("26 February") And ReportDate <= ("3 March") Or ReportDate >= ("28 May")
End Function
Please has anyone got a neat idea for this????????????
Steve