I am now making reports and no problem well I have a form where I do data entry but also have searchs and navigation of records. Anyway Say I want a particular record so click on search type a number and returns 6 records filtered. Then I click on add it will be the same number and the date automatically entered I will enter the values and then click on print. Well When I do that and heres the code:
Private Sub CmdPrintInspection_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.GoToControl "prnt_dat"
Prnt_dat.Value = Date
DoCmd.GoToControl "prnt_log"
Prnt_log.Value = Time()
On Error GoTo Err_cmdPrintInspection_Click
Dim stDocName As String
stDocName = "RptInspection"
DoCmd.OpenReport stDocName, acPreview
Exit_cmdPrintInspection_Click:
Exit Sub
Err_cmdPrintInspection_Click:
MsgBox Err.Description
Resume Exit_cmdPrintInspection_Click
End Sub
Now it throws an error message saying 2486 can't do this now. I know the error means something else is happening at the same time as I try to print. But I don't know what its causing and didn't know if anyone had any suggestions. I did notice that if I didn't filter the records it will print fine but if I filter it won't. Don't know if that helps much but any suggestions or tips be appreciated.
Private Sub CmdPrintInspection_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.GoToControl "prnt_dat"
Prnt_dat.Value = Date
DoCmd.GoToControl "prnt_log"
Prnt_log.Value = Time()
On Error GoTo Err_cmdPrintInspection_Click
Dim stDocName As String
stDocName = "RptInspection"
DoCmd.OpenReport stDocName, acPreview
Exit_cmdPrintInspection_Click:
Exit Sub
Err_cmdPrintInspection_Click:
MsgBox Err.Description
Resume Exit_cmdPrintInspection_Click
End Sub
Now it throws an error message saying 2486 can't do this now. I know the error means something else is happening at the same time as I try to print. But I don't know what its causing and didn't know if anyone had any suggestions. I did notice that if I didn't filter the records it will print fine but if I filter it won't. Don't know if that helps much but any suggestions or tips be appreciated.