Preselecting a value in a combo box

Hello,

I'm wondering if anyone can help me preselect a valuie in a combo box?  With the code below, I'm populating m combo as shown as in my jpg.  Now, how do I preselect V3 (2nd item)

After the code, I tried cboPaymLocs.ListIndex = 1 but I get '7777' - You've used the litstindex property incorrectly.

Any help is greatly appreciated.
strSQL = "SELECT * FROM [tblVehicles] " & _
             "WHERE (fldArchived = False) " & _
             "ORDER BY fldVehNo;"
             
    With CurrentDb.OpenRecordset(strSQL)
        If .RecordCount > 0 Then
            .MoveFirst
            Do While Not .EOF
                    
                strName = "Vehicle: " & .Fields("fldVehNo")
                cboPaymLocs.AddItem "V" & .Fields("fldVehID") & ";" & strName
                .MoveNext
            Loop
        End If
    End With
    
    strSQL = "SELECT * FROM [tblLocations] " & _
             "WHERE (fldArchived = False) " & _
             "ORDER BY fldLocID;"
             
    With CurrentDb.OpenRecordset(strSQL)
        If .RecordCount > 0 Then
            .MoveFirst
            Do While Not .EOF
                    
                strName = "Location: " & .Fields("fldLocation")
                cboPaymLocs.AddItem "L" & .Fields("fldLocID") & ";" & strName
                .MoveNext
            Loop
        End If
    End With

Open in new window

Picture1.jpg
APD TorontoSoftware DeveloperAsked:
Who is Participating?
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.

bromy2004Commented:
Try cboPaymLocs.Value=cboPaymLocs.ListIndex(1)
0
APD TorontoSoftware DeveloperAuthor Commented:
At the list indexd, I get
Wrong number of arguments or invalid property assignment.
0
Rey Obrero (Capricorn1)Commented:


cboPaymLocs.value=cboPaymLocs.itemdata(1)
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
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.