I am working with a form that has a button to print a record. It prints every record in the master table when clicked, but I only want it to print the last record. I am not sure how to code it....currently it is set as
Private Sub Command42_Click()
On Error GoTo Err_Command42_Click
Dim stDocName As String
stDocName = "Report1"
DoCmd.OpenReport stDocName, acNormal
Exit_Command42_Click:
Exit Sub
Err_Command42_Click:
MsgBox Err.Description
Resume Exit_Command42_Click
End Sub
I know there should be a where clause after the DoCmd but can't find anything to select last record.
Private Sub Command42_Click()
On Error GoTo Err_Command42_Click
Dim stDocName As String
stDocName = "Report1"
DoCmd.OpenReport stDocName, acNormal
Exit_Command42_Click:
Exit Sub
Err_Command42_Click:
MsgBox Err.Description
Resume Exit_Command42_Click
End Sub
I know there should be a where clause after the DoCmd but can't find anything to select last record.