Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    10

    Exclamation Unanswered: Runtime Error 2105 - Can't go to selected record

    Hello,

    I am getting this error everytime I try to open a particular form on my database.

    "Runtime error 2105 - Can't go to selected record"

    The form is just used for bookings, users enter data into it and save it.

    The particular part of code that seems to be causing the trouble is as follows:

    Private Sub Form_Open(Cancel As Integer)
    Dim thisday As Date, today As Date
    today = Format$(Now, "dd/mm/yyyy")
    Do
    If IsNull(Me!Date) Then
    DoCmd.GoToRecord acDataForm, "fmEventList", acNext
    Else
    thisday = Me!Date
    If thisday < today Then
    DoCmd.GoToRecord acDataForm, "fmEventList", acNext
    End If
    End If
    Loop Until thisday >= today


    End Sub

    The actual line of code that is highlighted as the error is as follows:

    If thisday < today Then
    DoCmd.GoToRecord acDataForm, "fmEventList", acNext


    Can anyone give me some pointers as to what has happened?

  2. #2
    Join Date
    Sep 2003
    Posts
    10
    Also, it only seems to affect user profiles on certain computers. A user can log onto one computer and it won't work, yet on another it will. On the computers that the database isn't working on, nobody can access it.

    Thanks.

  3. #3
    Join Date
    Sep 2003
    Posts
    10
    Me again.

    We also have an administrator account. The database works on all computers when logged in under this account, so its very strange indeed.

  4. #4
    Join Date
    Sep 2003
    Posts
    10
    bump

  5. #5
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228
    might sound silly but just to be sure, is the form on the last record when the error occours?

    why do you convert a date to a string and back to a date as in today = Format$(Now, "dd/mm/yyyy")? today = now should be sufficient. is Me!Date of type text or is a control on the form? step through the code and check the dates
    converting from text to date is always tricky due to different system locales. as an excersize check the results of these calls:
    cdate("01.13.2004")
    cdate("01.12.2004")
    cdate("13.01.2004")
    cdate("12.01.2004")
    the only REALLY reliable string date format (in VBA and NOT in Jet SQL as this always uses US standard date format) seems to be the ISO format YYYY-MM-DD as in cdate("2004-01-13"). Also a 2 digit year is problematic as well of course.

    if you run Access 2000 or XP try with
    Form_fmEventList.Recordset.MoveNext
    instead of
    DoCmd.GoToRecord acDataForm, "fmEventList", acNext
    seemed to be more reliable to me and works with anonymous form objects. but older versions don't support the recordset property on forms i think.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •