Greetings,
We use ACCESS to track data for our tenants.
We use a three letter abbreviation for the tenant and a 5 number year/serial number as the primary reference within our database.
The tenants are listed in a Table, it has relationships to other tables
Forms are used to enter/change data for the clients.
Recently, another tenant was added to the table of tenants. Since then, When I enter data for that tenant, the Macro(s) invoke the Case Else and displays the msg information.
It does save the inputted information.
All other functions for all other tenants have no issue.
There are four Macros that use this data, the first two are functions (add and change) use the same script to validate the tenant information; the second two are Private Subs, they are similar with slightly different data fields.
For brevity, I'm only providing what I think are the key statements.
Private Function VALIDTENANT()
Select Case TENANT.Value
Case "ABC":
Case "DEF":
(Total of 89 Case statements)
Else
MsgBox "INVALID SHIPNAME"
Me.SHIPANDCASNUM.SetFocus
Exit Sub
End If
Case "": MsgBox "PLEASE FILL OUT THE TENANT FIELD"
Case Else:
MsgBox "INVALID TENANT NAME"
Me.TENANT.SetFocus
' Me.TENANT.Text = ""
' Me.TENANT.SetFocus
End Select
End Function
Private Sub DOTHIS()
Dim statements...
If Left(Me.TENANT, 3) = "ABC" Or Left(Me.TENANT, 3) = "DEF" Or (all 89 tenants are listed here) Then
Else
MsgBox "INVALID TENANT NAME"
Me.TENANT.SetFocus
Exit Sub
End If
(Various "If" statements to validate information in the data fields.)
DoCmd.GoToRecord acDataForm, Me.Name, acNewRec
End Sub