Match value with combo

  • Thread starter Thread starter Anna
  • Start date Start date
A

Anna

Hi:
I try to match values with combo. Values are match but i dont know how
to set the combo with the match value. I ask the same question before
for ListBox and this method works with that. But when i try to use the
same with combo this wont allow me to set it according to the match
value.

Error:
Combo128.Selected(i) = True

-----------------------------------------------
Dim AccIDs(3)
qry1 = "select ID from selaccnt"
Set rst1 = CurrentDb.OpenRecordset(qry1)
If rst1.EOF = False Then
t = 0
rst1.MoveFirst
Do Until rst1.EOF
AccIDs(t) = rst1!Id
t = t + 1
rst1.MoveNext
Loop
End If

t = 0
Me.Combo128.RowSource = "SELECT LastValidTech.AccountID FROM
LastValidTech WHERE (((LastValidTech.TicketNum)=[Forms]![" &
Me.Parent.Name & "]![ticketnum]));"
With Me.Combo128
For i = 0 To Combo128.ListCount
If CStr(AccIDs(t)) = Combo128.ItemData(i) Then
Combo128.Selected(i) = True
t = t + 1
End If
Next
End With
 
Disregard the "cant do this with Access" message. It is SPAM (or worse).
Follow the link at your own peril...<g>

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Back
Top