R
ryguy7272
As the title says, I am trying to send a Value from a Form to a Report, so as
to filter for a certain record on the Report. The code fails on this line:
ID = "=" & Me.MR.Value & ""
I think it has to do with the number of quotes around the variable, but I
tried various combinations of things and couldn't get it working, so I'm not
sure if that is the problem or not.
Option Compare Database
Private Sub Command1_Click()
Dim ID As Integer
Dim Filter As Integer
DoCmd.OpenReport "MontefioreRADON", acPreview, , strFilter
If IsNull(Me.MR.Value) Then
ID = "Like *"
Else
ID = "=" & Me.MR.Value & ""
End If
strFilter = "[MR] " & ID
With Reports![MontefioreRADON]
.Filter = Filter
.FilterOn = True
End With
End Sub
I'd sincerely appreciate any help on this!!
Thanks,
Ryan--
to filter for a certain record on the Report. The code fails on this line:
ID = "=" & Me.MR.Value & ""
I think it has to do with the number of quotes around the variable, but I
tried various combinations of things and couldn't get it working, so I'm not
sure if that is the problem or not.
Option Compare Database
Private Sub Command1_Click()
Dim ID As Integer
Dim Filter As Integer
DoCmd.OpenReport "MontefioreRADON", acPreview, , strFilter
If IsNull(Me.MR.Value) Then
ID = "Like *"
Else
ID = "=" & Me.MR.Value & ""
End If
strFilter = "[MR] " & ID
With Reports![MontefioreRADON]
.Filter = Filter
.FilterOn = True
End With
End Sub
I'd sincerely appreciate any help on this!!
Thanks,
Ryan--