G
Guest
hi to all
This question isn't about code that doesn't work, but about code that does
(but I'm not sure why??)
In my form's header, I have an unbound combobox (cboSelectCityState) that is
used to find matching records in a subform (master/child link is
[City-StateID]). From a posting found in this forum several weeks ago, I got
this to work perfectly using the following code:
Private Sub cboSelectCityState_AfterUpdate()
If Not IsNull(cboSelectCityState) Then
Me.RecordsetClone.Findfirst "[City-StateID] = " &
Me![cboSelectCityState]
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
End Sub
Since then, I also got it to work perfectly using:
Private Sub cboSelectCityState_AfterUpdate()
Me.Filter = "[City-StateID] = " & cboSelectCityState.Value
Me.FilterOn = True
End Sub
My questions are:
a) Why does the first code fragment find multilple records (as I wanted)
even though 'FindFirst' was used?
b) Are there advantages/disadvantages to either method?
This question isn't about code that doesn't work, but about code that does
(but I'm not sure why??)
In my form's header, I have an unbound combobox (cboSelectCityState) that is
used to find matching records in a subform (master/child link is
[City-StateID]). From a posting found in this forum several weeks ago, I got
this to work perfectly using the following code:
Private Sub cboSelectCityState_AfterUpdate()
If Not IsNull(cboSelectCityState) Then
Me.RecordsetClone.Findfirst "[City-StateID] = " &
Me![cboSelectCityState]
Me.Bookmark = Me.RecordsetClone.Bookmark
End If
End Sub
Since then, I also got it to work perfectly using:
Private Sub cboSelectCityState_AfterUpdate()
Me.Filter = "[City-StateID] = " & cboSelectCityState.Value
Me.FilterOn = True
End Sub
My questions are:
a) Why does the first code fragment find multilple records (as I wanted)
even though 'FindFirst' was used?
b) Are there advantages/disadvantages to either method?