SQL & Programming
Private Sub City_List_AfterUpdate()
Dim SQLStmt, R As Recordset
SQLStmt = "SELECT DISTINCT state FROM businesses " _
& "WHERE state IS NOT NULL AND City = '" & Me![City List] & " ';"
Me![State List].RowSource = SQLStmt
Set R = CurrentDb.OpenRecordset(SQLStmt)
If R.RecordCount > 0 Then
If R.RecordCount = 1 Then
Me![State List] = R![State]
SQLStmt = "SELECT DISTINCT zip FROM businesses” _
& “WHERE city = '" & Me![City List] & "' AND state = '”_
& Me![State List] & "’ AND zip IS NOT NULL;"
Me![Zip List].RowSource = SQLStmt
Set R = CurrentDb.OpenRecordset(SQLStmt)
If R.RecordCount > 0 Then
If R.RecordCount = 1 Then