S
scottyb121 via AccessMonster.com
I am trying to view a report when you select a record and then click a button
on a form with this as the code:
Private Sub cmdEventLogReport_Click()
Dim stLinkCriteria As String
Dim stDocName As String
stDocName = "rptEventLogReport"
stLinkCriteria = "[PatientName]=" & Me.PatientName
'stLinkCriteria = "[PatientRecordID]=" & Me.PatientRecordID
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
[PatientName] is a field in a query that matches up with the patient name
field in the form. When I select the record and then press the button i get
a run time error '3075' and I can't figure it out. The code that is
commented out, when not commented out works just fine with [PatientRecordID]
a field in the query that matches up with the patient record id field in the
form.
on a form with this as the code:
Private Sub cmdEventLogReport_Click()
Dim stLinkCriteria As String
Dim stDocName As String
stDocName = "rptEventLogReport"
stLinkCriteria = "[PatientName]=" & Me.PatientName
'stLinkCriteria = "[PatientRecordID]=" & Me.PatientRecordID
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
[PatientName] is a field in a query that matches up with the patient name
field in the form. When I select the record and then press the button i get
a run time error '3075' and I can't figure it out. The code that is
commented out, when not commented out works just fine with [PatientRecordID]
a field in the query that matches up with the patient record id field in the
form.