Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    123

    Unanswered: Defaulting the list box selection to first row

    Is there a way to default the selected row in a list box to be the first row after the list box is populated with data? I.e., the list box is populated, but the user doesn't click on a row, but then clicks the button to the record details. This causes a run-time error because there is now row selected for the query to run.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Instead of defaulting a selection why not trap the error of no item being selected?
    Code:
    If ME.MyListbox.Value IS NULL Then
    Msgbox("Select something please")
    Else
    ...
    Endif
    George
    Home | Blog

  3. #3
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Or in the load event

    Me.ListBoxName.Selected(0) = True
    Paul

Posting Permissions

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