Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks
you should use the date 1/28/2014 if the date goes away.
Public Function myendofday(strmyday As Date) On Error GoTo Err_myendofday DoCmd.OpenForm ("frmpleasewait") DoCmd.RepaintObject acForm, "Frmpleasewait" Dim db As DAO.Database Dim rec As Recordset Dim Enderrormsg As Label Dim i As Integer Dim j As Integer Dim conflict As Integer 'system errors noted Dim intRnd As Integer Dim mycount As Integer 'total records done by user Dim Msg, Style, Title, Help, Ctxt, Response, MyString DoCmd.RepaintObject acForm, "Frmpleasewait" Set db = CurrentDb() 'Set rec = db.OpenRecordset("tblpublicrecordstimesheet") Set rec = db.OpenRecordset("qrysubrequesttime") conflict = 0 mycount = 0 Do While Not rec.EOF rec.Edit Select Case rec("systemnotesid") Case Is <> 0 conflict = conflict + 1 Case Is = 0 mycount = mycount + 1 End Select rec.MoveNext Loop rec.Close MsgBox (conflict) MsgBox (mycount) 'If conflict > 0 Then GoTo Enderrormsg Else DoCmd.OpenForm ("End of Day Response") If conflict > 0 Then GoTo Enderrormsg Else GoTo NoErrors NoErrors: MsgBox ("No Errors") DoCmd.Close acForm, "frmpleasewait" Msg = "Do you wish to authenticate the End of Day Report ?" Style = vbYesNo + vbCritical + vbDefaultButton2 Title = "End Of Day" Help = "DEMO.HLP" Ctxt = 1000 If mycount = 0 Then DoCmd.OpenForm ("End of Day Response") Else If mycount > 0 Then Response = MsgBox(Msg, Style, Title, Help, Ctxt) If Response = vbYes Then ' User chose Yes. MyString = "Yes" ' Perform some action. ' DoCmd.OpenForm ("End of Day Response") Dim rs As DAO.Recordset 'Me.TimerInterval = 0 Set rs = CurrentDb.OpenRecordset("Select * From tbleod") rs.AddNew rs!Employeeeod = Networkusername() rs!ReportDate = strmyday rs.Update rs.Close Dim myfilename As String myfilename = "W:\EndofDayReports\" myfilename = myfilename & DatePart("yyyy", strmyday) & "." & DatePart("m", strmyday) & "." & DatePart("d", strmyday) & "_" & Networkusername() myfilename = myfilename & ".pdf" DoCmd.OutputTo acOutputReport, "rptendofday", "PDFFormat(*.pdf)", myfilename, True, "", , acExportQualityScreen Else ' User chose No. MyString = "No" ' Perform some action. End If Exit Function Exit_myendofday: ' Label to resume after error. Exit Function ' Exit before error handler. Enderrormsg: MsgBox "You must correct error before submitting the End of Day report.!", vbOKOnly, "DB" DoCmd.Close acForm, "frmpleasewait" Exit Function Err_myendofday: ' Label to jump to on error. MsgBox Err.Number & Err.Description ' Place error handling here. DoCmd.Close acForm, "frmpleasewait" Resume Exit_myendofday End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.