Problem with record navigation

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
 
W

Wayne Morgan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top