bikeshox13
New member
- Local time
- Today, 04:43
- Joined
- Jan 14, 2010
- Messages
- 3
I have a Form that has a button that will print a report only for the current record displayed on the form. The button works great except for when entering a new record. I have to go to a different record and then come back to the new record in order for the record to print. I'm guessing i need something to update the report when clicking the button. Any ideas? Here is the code for the button.
Private Sub btnPrint_Click()
'Print current record
'using CAR Number.
If IsNull(Me![CARNUM]) Then
MsgBox "Please select a valid record", _
vbOKOnly, "Error"
Exit Sub
End If
DoCmd.OpenReport "rptPrintCurrent", , , _
"[CARNUM] = " & Me![CARNUM]
End Sub
Private Sub btnPrint_Click()
'Print current record
'using CAR Number.
If IsNull(Me![CARNUM]) Then
MsgBox "Please select a valid record", _
vbOKOnly, "Error"
Exit Sub
End If
DoCmd.OpenReport "rptPrintCurrent", , , _
"[CARNUM] = " & Me![CARNUM]
End Sub