Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    3

    Question Unanswered: you can't go to specified record help!

    I keep getting this error when i try to click the logon button. I am new at this so be explanitory would help alot. Here is the code that keeps throwing the error. Thank you for any help you can give me.

    *= where the error occurs

    If (Not rsTable.NoMatch) And (Not nonactive) Then
    If toolcheck = 0 Then
    If LegalName = 1 Then
    Tool2 = Tool
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    DoCmd.GoToRecord , , acNext
    Call TransferData
    success = Activate(Tool2, 1)

    If success = 1 Then
    MsgBox "Log On Successful!"
    Else
    MsgBox "There was an error turning on machine, please try again or see administrator for help"
    End If
    rslogon.MoveLast
    rslogon.Delete


    Else 'LegalName = 0
    MsgBox "Tool Name Not Valid. Information being deleted"
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    DoCmd.GoToRecord , , acNext
    rslogon.MoveLast
    rslogon.Delete
    End If 'If LegalName = 1/0
    Else 'Toolcheck = 1
    MsgBox "Tool is already in use. Information being deleted"
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    *DoCmd.GoToRecord , , acNext
    rslogon.MoveLast
    rslogon.Delete
    End If 'If Toolcheck = 0/1
    Else 'rsTable.NoMatch = 0
    MsgBox message
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
    DoCmd.GoToRecord , , acNext
    rslogon.MoveLast
    rslogon.Delete

    End If 'If rsTable.NoMatch = 0/1

  2. #2
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346
    Did you check if you are already on the last record when you try to move the cursor to the next position?

    Here is your code with tabs that makes it easier to read

    Code:
    If (Not rsTable.NoMatch) And (Not nonactive) Then
        If toolcheck = 0 Then
            If LegalName = 1 Then
                Tool2 = Tool
                DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
                DoCmd.GoToRecord , , acNext
                Call TransferData
                success = Activate(Tool2, 1)
    
                If success = 1 Then
                    MsgBox "Log On Successful!"
                Else
                    MsgBox "There was an error turning on machine, please try again or see administrator for help"
                End If
                rslogon.MoveLast
                rslogon.Delete
    
            Else 'LegalName = 0
                MsgBox "Tool Name Not Valid. Information being deleted"
                DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
                DoCmd.GoToRecord , , acNext
                rslogon.MoveLast
                rslogon.Delete
            End If 'If LegalName = 1/0
        Else 'Toolcheck = 1
            MsgBox "Tool is already in use. Information being deleted"
            DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
            DoCmd.GoToRecord , , acNext
            rslogon.MoveLast
            rslogon.Delete
        End If 'If Toolcheck = 0/1
    Else 'rsTable.NoMatch = 0
        MsgBox message
        DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
        DoCmd.GoToRecord , , acNext
        rslogon.MoveLast
        rslogon.Delete
    End If 'If rsTable.NoMatch = 0/1
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

  3. #3
    Join Date
    Jul 2004
    Posts
    3

    Unhappy

    Yeah sadly I am not at the last record. Anymore ideas?? Thanks for the help

  4. #4
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    It is a little difficult to suggest what is wrong without an indication of what type of form it is (single/continues) or what the relationship, if any, is between the form records and the other recordsets that are open. However, it may help if we know what the error message is ?

    You also have the same code sequence in more than one place; does it work in the other locations?

    Just some thoughts.

    MTB

Posting Permissions

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