Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selecting records in list box

Status
Not open for further replies.

MJD1

Technical User
Jul 18, 2003
134
CA
hi, does anyone know if there is a way to have all records in a list box automatically selected when the form is open?

thanks
 
How are ya MJD1 . . .

In the forms [blue]On Load[/blue] event, copy/paste the following:
Code:
[blue]   Dim LBx As ListBox, idx As Long
   
   Set LBx = Me![[purple][B][I]YourListboxName[/I][/B][/purple]]
   
   For idx = 0 To LBx.ListCount - 1
      LBx.Selected(idx) = True
   Next
   
   Set LBx = Nothing[/blue]
[blue]Your Thoughts? . . .[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Aceman, it worked like a charm. thanks for the help!!

Martin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top