I am trying to set the value of a combo box based on the selection of a list box. I have created a very simple generic form to try to achieve this goal, but without success. The form has a list box bound to a query, a button, and a combo box bound to another query. The queries for the list box and the combo box are independent. I can set the value of the combo box when the form loads (sub Form_Load) and when I click on the button (sub Command2_Click) , but when I make a selection in the list box (sub List5_AfterUpda te) I get Runtime error 2115: The Macro of function set to the BeforeUpdate or ValidationRule property for this field is preventing MS Access from saving the date in the field. I do not have any validation rules set and this is a complete listing of my code.
Code:
Private Sub Command2_Click()
Me.Combo0.SetFocus
Me.Combo0.ListIndex = 2
End Sub
Private Sub Form_Load()
Me.Combo0.SetFocus
Me.Combo0.ListIndex = 0
End Sub
Private Sub List5_AfterUpdate()
Me.Combo0.SetFocus
Me.Combo0.ListIndex = 3
End Sub
Comment