Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2010
    Posts
    4

    Unanswered: compile error on goto record from onscreen numberic keypad

    I CREATED NUMERIC BUTTONS TO NAVIGATE THROUGH RECORDS.
    ONCE I TYPE THE NUMBER I NEED TO CREATE THE ENTER KEY SO THAT I CAN GO TO THE SPECIFIG RECORD.

    I HAVE THE FOLLOWING CODE:

    Me.Combo117 = Me.Combo117 & "2" AND SO ON FOR ALL NUMBERS.

    FOR THE ENTER KEY I HAVE:
    Me.Combo117.SetFocus
    DoCmd.GoToRecord = Me.Combo117

    BUT I GET ERROR AND I CAN NOT FIGURE OUT ANY SOLUTION.

    THANKS IN ADVANCE

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Can you specify what error you get (err.number and err.description)?

    You should try (provided that the rest is correct):
    Code:
    Me.Combo117.Value
    Moreover, the correct syntax is:
    Code:
    expression.GoToRecord(ObjectType, ObjectName, AcRecord, Reference)
    With AcRecord being acFirst, acGoto, acLast, acNewRec, acNext (default) or acPrevious.

    The arguments are optional but you still have to provide the separators if you omit some of them. Ex.:
    Code:
    Docmd.GotoRecord ,, AcNext
    In your case it should be:
    Code:
    Docmd.GotoRecord ,, acGoto, Me.Combo117.Value
    Have a nice day!

Posting Permissions

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