Why does a selection from a combo box displays the first option in the box instead of the selected option. Correct calculations are however performed on the selected option. Here is the code.
If cboSite.Value <> "(ALL)" Then
With Me!cboCategory
.RowSource = "SELECT DISTINCT [Picture Gallery].SiteCode, " & _
"[Picture Gallery].Category FROM [Picture Gallery] " & _
"WHERE [Picture Gallery].SiteCode = '" & cboSite.Column(2) & "' " & _
"UNION SELECT ' ', '(ALL)' FROM [Picture Gallery] "
.ColumnCount = 2
.ColumnWidths = "0 in; 1 in"
.Requery
End With
If cboSite.Value <> "(ALL)" Then
With Me!cboCategory
.RowSource = "SELECT DISTINCT [Picture Gallery].SiteCode, " & _
"[Picture Gallery].Category FROM [Picture Gallery] " & _
"WHERE [Picture Gallery].SiteCode = '" & cboSite.Column(2) & "' " & _
"UNION SELECT ' ', '(ALL)' FROM [Picture Gallery] "
.ColumnCount = 2
.ColumnWidths = "0 in; 1 in"
.Requery
End With