A
akrashid
Hi All,
I have a Access 2003 application. Here is my problem.
When I create a new record and then right away I want to print it. I
get an error saying "This record contains no data" even though data is
in the form. If I then scroll the mouse button up or down one record or
more and come back to my current record it prints fine. Some how I am
not picking my current record's autonumber.
Thanks for all your help.
Here is the code, my ID field is a autonumber field:
==================================================
Private Sub Command219_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "IT_TR_REPORT"
strCriteria = "[ID]=" & Me![ID]
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
End If
End Sub
==========================================================
I have a Access 2003 application. Here is my problem.
When I create a new record and then right away I want to print it. I
get an error saying "This record contains no data" even though data is
in the form. If I then scroll the mouse button up or down one record or
more and come back to my current record it prints fine. Some how I am
not picking my current record's autonumber.
Thanks for all your help.
Here is the code, my ID field is a autonumber field:
==================================================
Private Sub Command219_Click()
Dim strReportName As String
Dim strCriteria As String
If NewRecord Then
MsgBox "This record contains no data." _
, vbInformation, "Invalid Action"
Exit Sub
Else
strReportName = "IT_TR_REPORT"
strCriteria = "[ID]=" & Me![ID]
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
End If
End Sub
==========================================================