I have a combobox cboDept that when clicked sets its value to 'dept' (which is global). It then makes another combobox cboBldAddress visible and set it to have focus. When executed the cboBldAddress combo never loads. Where's there pilot's error? For brevity i have cut the other Case statements.
Private Sub cboDept_Click()
dept = cboDept.Value
Me.cboBldAddress.Visible = True
Me.cboBldAddress.SetFocus
End Sub
Private Sub cboBldAddress_GotFocus()
Dim sql As String
Select Case dept
Case "Administrative"
ssql = "select address from building where department = 'Administration'"
cboBldAddress.RowSourceType = "Table/Query"
cboBldAddress.RowSource = ssql
Me.cboBldAddress.Requery
End Select
End Sub