Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Missing syntax (MSACCESS 2003)

    i have a command button that sets the rowsource of a listbox to display only the last record in a table. That works okay, but I want it to then select the listbox item.

    I have tried:

    Me.List25.SetFocus
    List25_Click

    But it produces an error message saying there is missing syntax whilst running through the list requery after clicking
    takes place. The listbox has rowheadings, and contains one record. Any ideas what is wrong. Thanks

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Missing syntax (MSACCESS 2003)

    What is the code for List25_Click?

  4. #3
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Missing syntax (MSACCESS 2003)

    Hi Hans,

    It crashes out during:

    Set RS2 = Me.RecordsetClone
    RS2.FindFirst "[ID2] = " & Me![list]
    Me.Bookmark = RS2.Bookmark

    So I guess it's not getting the value from list25. If I click the list manually it works okay.

    Thanks, Regards

  5. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Missing syntax (MSACCESS 2003)

    Try replacing the line

    Me.List25.SetFocus

    with

    Me.List25 = Me.List25.ItemData(0)

  6. #5
    4 Star Lounger
    Join Date
    Feb 2008
    Location
    United Kingdom
    Posts
    490
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Missing syntax (MSACCESS 2003)

    Many thanks. That fixed it Best regards

Posting Permissions

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