MS Access Unbound form needs to automatically select items in list.

MS Access unbound form needs to have users selected.  The two users need to be automatically selected instead of manually selecting the users.
donnie91910Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

COACHMAN99Commented:
ARE THE USERS IN TWO TEXT BOXES?
AND CAN YOU NOT ASSIGN THE TEXT PROPERTY OF THE BOXES TO THE USERS IN QUESTION?
IF USING A LIST BOX, SET TO MULTI-SELECT and assign accordingly
e.g.
for i as integer = 0 to listbox1.items.count -1
   listbox1.setselected(i,True)
next
0
Gustav BrockCIOCommented:
Automatically selected?

How, and by which criteria?
0
John TsioumprisSoftware & Systems EngineerCommented:
Just make the values of the users loaded during the Load Event and you should be good to go...better to post a screenshot to give us more info
0
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

donnie91910Author Commented:
The unbound form loads the values in the form with a select statement.  What would the code look like in the Load Event?  I have attached what the form looks like.
0
donnie91910Author Commented:
0
Gustav BrockCIOCommented:
Then, after loading the values from the query:

Private Sub Form_Load()

    ' Fill ListBox from your query.

    ' Select the first and second item.
    With Me!ListUsers
        .Selected(0) = True
        .Selected(1) = True
    End With
    
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gustav BrockCIOCommented:
Answer provided.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.