I've been trying to figure this out for hours now. I need the code to Preview a report for only the current record on my form without prompting for the ID.
I'm making a patient report database.
This is the code I'm using now... is there a way I could simply revise this code so I won't have to enter the PatientID every time I want to preview the Consult report? Please help... people are counting on me.
BTW... it took me forever to figure the code below out. I'm no expert.
Private Sub Command70_Click()
On Error GoTo Err_Command70_Click
Dim stDocName As String
stDocName = "Consult"
DoCmd.OpenReport stDocName, acPreview, , "[PatientID]=[Forms]![PatientInfo]![PatientID]"
Exit_Command70_Click:
Exit Sub
Err_Command70_Click:
MsgBox Err.Description
Resume Exit_Command70_Click
End Sub
I'm making a patient report database.
This is the code I'm using now... is there a way I could simply revise this code so I won't have to enter the PatientID every time I want to preview the Consult report? Please help... people are counting on me.
BTW... it took me forever to figure the code below out. I'm no expert.
Private Sub Command70_Click()
On Error GoTo Err_Command70_Click
Dim stDocName As String
stDocName = "Consult"
DoCmd.OpenReport stDocName, acPreview, , "[PatientID]=[Forms]![PatientInfo]![PatientID]"
Exit_Command70_Click:
Exit Sub
Err_Command70_Click:
MsgBox Err.Description
Resume Exit_Command70_Click
End Sub