Hello,
I have form where beforeupdate I have the following codes for preventing duplicate report date data entry, but i want to add one more code in case someone skips daily report to give them warning pop up message telling them they are skipping report date and if it is OK let them proceed if not let them enter the date that is missing. For example if today is 06/29/09 and there were no report entered yesterday 06/28/09. When they enter todays date I want then to get message reminding them "there were no data entry yesterday and if they want to preceed yes or no option"
Yes = Thay can then proceed and enter today's report
No = Cancel the date they entred and they can enter yesterday's report.
Private Sub Report_Date_BeforeUpdate(Cancel As Integer)
Dim rs As Object
Dim NewItem As Date
Set rs = Me.Recordset.Clone
If DCount("ReportDate", "TblDailyManager", "[ReportDate] = #" & Me.ReportDate & "#") > 0 Then
NewItem = Me.ReportDate
Me.Undo
rs.FindFirst "[ReportDate] = #" & Format(NewItem, "mm\/dd\/yyyy") & "#"
If Not rs.EOF Then
Me.Bookmark = rs.Bookmark
Else
MsgBox "This date has already been entered go to Correction to Manager Report form Item 6 and ubdate the information there [" & NewItem & "]"
End If
End If
End Sub
I have form where beforeupdate I have the following codes for preventing duplicate report date data entry, but i want to add one more code in case someone skips daily report to give them warning pop up message telling them they are skipping report date and if it is OK let them proceed if not let them enter the date that is missing. For example if today is 06/29/09 and there were no report entered yesterday 06/28/09. When they enter todays date I want then to get message reminding them "there were no data entry yesterday and if they want to preceed yes or no option"
Yes = Thay can then proceed and enter today's report
No = Cancel the date they entred and they can enter yesterday's report.
Private Sub Report_Date_BeforeUpdate(Cancel As Integer)
Dim rs As Object
Dim NewItem As Date
Set rs = Me.Recordset.Clone
If DCount("ReportDate", "TblDailyManager", "[ReportDate] = #" & Me.ReportDate & "#") > 0 Then
NewItem = Me.ReportDate
Me.Undo
rs.FindFirst "[ReportDate] = #" & Format(NewItem, "mm\/dd\/yyyy") & "#"
If Not rs.EOF Then
Me.Bookmark = rs.Bookmark
Else
MsgBox "This date has already been entered go to Correction to Manager Report form Item 6 and ubdate the information there [" & NewItem & "]"
End If
End If
End Sub