D
Dennis
I am trying to transfer data from a form, press a button
and open a report that has a select distinct query and
paste the data in the "CDC_NBR" field/criteria window
which requests the user to enter that ID number. The
following is the code I have but I get an error message
that says
"Syntax error (missing operator) in query
expression '(Patients Current RX Query.CDC_NBR='B-12345)'.
The B-12345 is the value I wish to paste into the reports
Select Distinct query [CDC_NBR] field.
Private Sub View_current_Rx_Button_Click()
On Error GoTo Err_View_current_Rx_Button_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Patient's Current RX Report"
stLinkCriteria = "Patient's Current Rx Query.CDC_NBR="
& "'" & Me.CDC_NBR
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
Exit_View_current_Rx_Button_Click:
Exit Sub
Err_View_current_Rx_Button_Click:
MsgBox Err.Description
Resume Exit_View_current_Rx_Button_Click
End Sub
What might be the problem?
Thanks,
Dennis
and open a report that has a select distinct query and
paste the data in the "CDC_NBR" field/criteria window
which requests the user to enter that ID number. The
following is the code I have but I get an error message
that says
"Syntax error (missing operator) in query
expression '(Patients Current RX Query.CDC_NBR='B-12345)'.
The B-12345 is the value I wish to paste into the reports
Select Distinct query [CDC_NBR] field.
Private Sub View_current_Rx_Button_Click()
On Error GoTo Err_View_current_Rx_Button_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Patient's Current RX Report"
stLinkCriteria = "Patient's Current Rx Query.CDC_NBR="
& "'" & Me.CDC_NBR
DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria
Exit_View_current_Rx_Button_Click:
Exit Sub
Err_View_current_Rx_Button_Click:
MsgBox Err.Description
Resume Exit_View_current_Rx_Button_Click
End Sub
What might be the problem?
Thanks,
Dennis