Joined
·
1,057 Posts
I have the following code that selects which db the data gets posted to:
I am having trouble with users leaving either the year or the business blank - in this case the code is defaulting to the Else choice and posting to the wrong db. I was wondering if I could handle the problem this way:
Code:
If varBusName = "Citi" Then
Select Case varYrA
Case "2002"
varDB = "Training_Delivery_Data.mdb"
'more Cases for each year
End Select
Else
Select Case varYrA
Case "2002"
varDB = "Training_Delivery_DataSears.mdb"
'more Cases for each year
End Select
End If
Code:
If varBusName = "Citi" Then
Select Case varYrA
Case "2002"
varDB = "Training_Delivery_Data.mdb"
'more Cases for each year
End Select
ElseIF varBusName = "Sears" Then
Select Case varYrA
Case "2002"
varDB = "Training_Delivery_DataSears.mdb"
'more Cases for each year
End Select
Else
'Redirect to an Error Page instructing them to make a choice in the dropdowns
[I][B]How do I get it to check for both values before posting?[/B][/I]
End If