I have a combobox with a query as it's row source. I'm trying to assign a value to the combobox via VBA and then run an After Update procedure to set the values of fields to different columns in the combobox for the row that the string corresponds to.
The after update procedure works when i click the dropdown and select a value from the combo.
The VBA works to take a variable string and assign it to the combobox as it's value. However, when the string is assigned to the combo the corresponding row is not actually being selected and therefore an After Update procedure is not being run.
After I assign the string value to the combo, if I click the drop-down, the row I would like to return is highlighted, but nothing happens until i press the enter key.
Let me know if you need more specifics, the bulk of my code for what goes into the combo is below. The combo is Val1GnSched. The string I'm assigning is "CurrGroupSched"
Code:
CurrGroupSched = ""
For CurrAcc = 1 To AccCount
If Me("V1Group" & CurrAcc).Value = CurrGroup Then
CurrGroupMV = CurrGroupMV + Me("MV" & CurrAcc).Value
If CurrGroupSched = "" Then
CurrGroupSched = Me("V1Sched" & CurrAcc).Value
ElseIf CurrGroupSched <> Me("V1Sched" & CurrAcc).Value Then
MsgBox ("sample")
Exit Sub
End If
End If
Next CurrAcc
Me("Val1G" & CurrGroup & "Sched").Value = CurrGroupSched