use combo box value to move to record

  • Thread starter Thread starter mcnews
  • Start date Start date
M

mcnews

i'm using a bound form that contains combo boxes that have values from
the table that is bound to the form.
for axample social sec number. there will only be a hundred or so
records so it won't be that bad.

how do i move to the recrord that the combo box contains the value
for?

NOTE: please try to answer without lecturing about what microsoft or
somebody thinks about filling combo boxes.
 
mcnews said:
i'm using a bound form that contains combo boxes that have values from
the table that is bound to the form.
for axample social sec number. there will only be a hundred or so
records so it won't be that bad.

how do i move to the recrord that the combo box contains the value
for?

NOTE: please try to answer without lecturing about what microsoft or
somebody thinks about filling combo boxes.

A ComboBox is either used to navigate records (what you want) OR it is
bound. You cannot use the same ComboBox for both. The ComboBox wizard will
build an unbound control for navigating.
 
Me.RecordsetClone.Findfirst "[ID] = " & Me![ComboOrListboxName]
Me.Bookmark = Me.RecordSetClone.Bookmark
 
A ComboBox is either used to navigate records (what you want) OR it is
bound. You cannot use the same ComboBox for both. The ComboBox wizard will
build an unbound control for navigating.

danged if you ain't correct!
had to fix that real quick.
 
Although unlikely, you should always include code that will not try to
navigate to the record if it was not found:

With Me.RecordsetClone
.Findfirst "[ID] = " & Me![ComboOrListboxName]
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
 
Back
Top