Hello! First time poster on here! Here is my situation:
My end product will be a little bit more complex but as of right now, I am just trying to make things work. I am using a pop-up form that allows the user to choose values from a table. The values are then to be used to filter the data in a report. I am getting a datatype mismatch error (error 3464) on the below code:
Code:
Private Sub cmdApplyFilter_Click()
Dim strTeam As String
Dim strFilter As String
If IsNull(Me.cboTeam.Value) Then
strTeam = "[Team] Like '*'"
Else
strTeam = "='" & Me.cboTeam.Column(1) & "'"
End If
strFilter = "[Team] " & strTeam
With Reports![Soldier Details Report]
.Filter = strFilter
.FilterOn = True
End With
I am getting the error on the .Filter properties. I did some research and the only thing I can think of is since i am coding this based from a form, Access is assuming I am referring to the .Filter property for a form instead of a report and it provides me with the error. Only thing is, I don't know how to refer to the report .Filter etc. Any advice would be great, thanks!