Your ELSEIFs are not needed. It restricts the update to a single column, not checking the others. And as WGM states you need the delimiters. Also make allowance for optional county.
Code:
Private Sub CmdSet_Click()
If IsNull(TxtCity) Or IsNull(TxtState) Or IsNull(TxtZipCode) Then
MsgBox "You must enter City, State & ZipCode, County is Optional"
Exit Sub
End If
Dim strSQL As String
Dim db As DAO.Database
Set db = CurrentDb
'See if ZipCode Exist, If not add to table
If Not IsNull(DLookup("ZipCode", "tblSysZipCode", "ZipCode='" & Me.TxtZipCode & "'")) = 0 Then
strSQL = "INSERT INTO tblSysZipCode (ZipCode) " & "VALUES (" & TxtZipCode & ")"
Debug.Print strSQL
db.Execute strSQL, dbFailOnError
End If
'See if City Exist, If not add to table
If Not IsNull(DLookup("City", "tblSysCity", "City='" & Me.TxtCity & "'")) = 0 Then
strSQL = "INSERT INTO tblSysCity (City) " & "VALUES ('" & TxtCity & "')"
Debug.Print strSQL
db.Execute strSQL, dbFailOnError
End If
'See if State Exist, If not add to table
If Not IsNull(DLookup("State", "tblSysState", "State='" & Me.TxtState & "'")) = 0 Then
strSQL = "INSERT INTO tblSysState (State) " & "VALUES ('" & TxtState & "')"
Debug.Print strSQL
db.Execute strSQL, dbFailOnError
End If
'See if County Exist, If not add to table
If Not IsNull(DLookup("County", "tblSysCounty", "County='" & Me.TxtCounty & "'")) = 0 Then
strSQL = "INSERT INTO tblSysCounty (County) " & "VALUES ('" & TxtCounty & "')"
Debug.Print strSQL
If TxtCounty <> "" Then db.Execute strSQL, dbFailOnError
End If
'Forms!frmBusiness.sfrmBusinessAddress.Form.TxtCity = TxtCity
'Forms!frmBusiness.sfrmBusinessAddress.Form.TxtState = TxtState
'Forms!frmBusiness.sfrmBusinessAddress.Form.TxtCounty = TxtCounty
Set db = Nothing
DoCmd.Close acForm, "frmSysZipLookUpBusiness", acSaveYes
End Sub
Another problem, since County is optional, form frnZip needs this NZ
Code:
If ZC = 1 Then
' ZIP code exists and there's only ONE record
ID = Nz(DLookup("CSZID", "tblSysCSZ", "ZipCode=""" & TxtZip & """"), 0)
sCity = DLookup("City", "tblSysCSZ", "CSZID=" & ID)
sState = DLookup("State", "tblSysCSZ", "CSZID=" & ID)
'county is optional so might be missing
sCounty = Nz(DLookup("County", "tblSysCSZ", "CSZID=" & ID), "")
Else