Hi All,
I have put the following code in the 'After Update' of a combo box:
Private Sub ComboTeam_AfterUpdate()
lblSurnameNotify.Visible = True
Me!ComboSurname = Null
Me!ComboSurname.Requery
If Me.ComboTeam.Value = "*" Then
Me.ComboSurname.RowSource = "SELECT DISTINCT Staff.Surname FROM Staff
WHERE (((Staff.Dept) Like forms!Form1!comboDept));"
Else
Me.ComboSurname.RowSource = "SELECT DISTINCT Staff.Surname FROM Staff
WHERE (((Staff.Team) Like forms!Form1!comboTeam)); "
End If
End Sub
Below this combo box I have the ComboSurname combo box with the
following code:
Private Sub ComboSurname_AfterUpdate()
Me!ComboForename = Null
Me!ComboForename.Requery
lblForenameNotify.Visible = True
End Sub
For some reason, the comboForename combo box does not requery and the
ForenameNotify label does not display.
I have a feeling it is because of the 'If' statement that the code
isn't executing but wondered if anybody could shed any light on this?
Thanks a lot for reading.
R.