Sorting List Box Choices

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • suzanne099
    New Member
    • Mar 2007
    • 7

    Sorting List Box Choices

    Hello Everyone...

    I have been trying to figure out how to sort the data in a list box. (I want the data in the Pick_Batch list box to be sorted by batch_num.) I've tried the following code, but have been unsuccessful.

    [Pick_Batch].RowSource = "Select [batch_num], [batch_receive], [count], [tag_batch] From [tbl_batch] WHERE idnum = '" & Me![Pick_Facility] & "' SORT ORDER [batch_num] "


    As you can tell from the code, the data populating the list box, Pick_Batch, is based on the choice of another list box (Pick_Facility). Using this code, the list box becomes blank. I am not sure what to try next. Any help anyone could offer would be extremely apprciated.

    Thank you.

    Suzanne
  • JConsulting
    Recognized Expert Contributor
    • Apr 2007
    • 603

    #2
    Originally posted by suzanne099
    Hello Everyone...

    I have been trying to figure out how to sort the data in a list box. (I want the data in the Pick_Batch list box to be sorted by batch_num.) I've tried the following code, but have been unsuccessful.

    [Pick_Batch].RowSource = "Select [batch_num], [batch_receive], [count], [tag_batch] From [tbl_batch] WHERE idnum = '" & Me![Pick_Facility] & "' SORT ORDER [batch_num] "


    As you can tell from the code, the data populating the list box, Pick_Batch, is based on the choice of another list box (Pick_Facility). Using this code, the list box becomes blank. I am not sure what to try next. Any help anyone could offer would be extremely apprciated.

    Thank you.

    Suzanne

    Code:
    [Pick_Batch].RowSource = "Select [batch_num], [batch_receive], [count], [tag_batch] From [tbl_batch] WHERE idnum = '" & Me![Pick_Facility] & "'  ORDER By [batch_num] ;"

    Comment

    • suzanne099
      New Member
      • Mar 2007
      • 7

      #3
      Originally posted by JConsulting
      Code:
      [Pick_Batch].RowSource = "Select [batch_num], [batch_receive], [count], [tag_batch] From [tbl_batch] WHERE idnum = '" & Me![Pick_Facility] & "'  ORDER By [batch_num] ;"

      Thank you so much. I guess that was a stupid question. But I was stumped for days.

      Comment

      Working...