Problem with record navigation

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to navigate through records on a form w/a combo box.

I have this code running in the combo box.

Dim rs As Object

FilterOn = False
Set rs = Me.Recordset.Clone
rs.FindFirst "[CID] = " & Str(Me![cboCandNo])
Me.Bookmark = rs.Bookmark

cboCandNo is a list of all CID's

For example CID's 1-100

Any time you select CID 37, no matter what CID you select, the form
automatically jumps to CID 45. The code works fine for all other CID's.

Seems pretty weird to me.
Any Ideas?

TIA,
TimJ
 
First, is CID a number or text field in the underlying table? If it is a
number, you don't need the Str() function. Also, the Str() function will
leave a leading space in front of the number for the sign. To eliminate
this, it may be better to use CStr().

Next, have you done a Compact and Repair? It may be that the index on this
field is corrupted. Doing a Compact and Repair will force a rewrite of the
index.
 
Back
Top