Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2000 - FindFirst moves to wrong record 2

Status
Not open for further replies.

JoeAtWork

Programmer
Jul 31, 2005
2,285
CA
Wondering if anybody has seen a similar error.
I upsized an Access2000 database to an SQL Server Express backend, tables in the front-end have an ODBC link.

There is code in the search screen to move to a particular record on the main screen:
Code:
On Error Resume Next
Dim Findval As String
Findval = Me.Student_ID.Value
DoCmd.Close
DoCmd.OpenForm "frmmainstudentpersonaldata"
Forms!frmMainStudentPersonalData.RecordsetClone.FindFirst "[student id] = " & Findval
Forms!frmMainStudentPersonalData.Bookmark = Forms!frmMainStudentPersonalData.RecordsetClone.Bookmark
What I am finding is that on the main form it is often on the wrong record. It seems to happen more often on the newer records.

I have noticed that it always seems to be offset by the same amount, by -26511, from the primary key it is supposed to be on. For example, if it is supposed to be on the record where [Student ID] = 44813, it ends up on the record with [Student ID] = 18302.

This happens if I run the front-end on Access2000, but not on Access2003. Unfortunately my client has Office2000.

 
Joe

I can't tell about the error but you could use the WhereCondition for the OpenForm method of the DoCmd object to get to that record.
 
Try removing the on error resume next and see if you get an error

ck1999
 
ck1999 - no error after removing the Resume Next, exact same behaviour

Jerry - that's exactly what I ended up doing, although I wanted to try to get the old method working as the users are not used to seeing the form in filtered mode. However, the solution seems to be acceptable and has the added benefit of opening faster than using FindFirst.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top