G
Guest
The following code is adapted from Allen Browne’s “Using a Combo Box to Find
Records†Tip.
Dim rs As DAO.Recordset
If Not IsNull(Me.cboMoveTo) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[DistrictID] = " & Me.cboMoveTo
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
It’s working fine and I understand it. But, I want to add a second variable
to look for. In other words, I want to “find the first record where the
DistrictID = Me.cboMoveTo AND the SeasonID = Me.cboSeasonPicker.â€
I’m stuck on how and where to add that second search string. I’ve tried
adding it at the end of the rs.FindFirst line, but it doesn’t accept it.
Anyone help me?
Records†Tip.
Dim rs As DAO.Recordset
If Not IsNull(Me.cboMoveTo) Then
'Save before move.
If Me.Dirty Then
Me.Dirty = False
End If
'Search in the clone set.
Set rs = Me.RecordsetClone
rs.FindFirst "[DistrictID] = " & Me.cboMoveTo
If rs.NoMatch Then
MsgBox "Not found: filtered?"
Else
'Display the found record in the form.
Me.Bookmark = rs.Bookmark
End If
Set rs = Nothing
End If
It’s working fine and I understand it. But, I want to add a second variable
to look for. In other words, I want to “find the first record where the
DistrictID = Me.cboMoveTo AND the SeasonID = Me.cboSeasonPicker.â€
I’m stuck on how and where to add that second search string. I’ve tried
adding it at the end of the rs.FindFirst line, but it doesn’t accept it.
Anyone help me?