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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Items in ListBox with Code 1

Status
Not open for further replies.

sds568219

Technical User
Dec 30, 2006
11
US
Problem: I have a form that generates an email to the system administrators. There is a lboAdminEmail that is populated by code and only contains email addresses of select individuals. I have a cmdButton that generates an email and puts the email addresses in the To: block. But only after I select the email addresses from the lboAdminEmail. Is there a way to select those items automatically when the form opens instead of having to select each one of them?

Steve

 
How about:
Code:
Private Sub Form_Load()
For i = 0 To Me.lboAdminEmail.ListCount
    Me.lboAdminEmail.Selected(i) = True 
Next
End Sub
 
Remou,

Once again I have to pass on my thanks. This worked perfectly.

Steve

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top