seems simple--If/ElseIf/Else

lscheer

Registered User.
Local time
Today, 17:01
Joined
Jan 20, 2000
Messages
185
I have some seemingly simple code on the BeforeUpdate event on a form:
If (Me![TribeOrgName].Column(0) < 1000) Then
Me![InstrCategory] = "TRIBAL"
ElseIf (Me!TribeOrgName = "US EPA") Then
Me![InstrCategory] = "EPA"
ElseIf (Me!TribeOrgName = "US EPA OAQPS") Then
Me![InstrCategory] = "EPA"
Else: Me![InstrCategory] = "Other"
End If

The first and last lines are evaluated correctly. The problem is that if the Me!TribeOrgName value is in one of the "else if" lines, the InstrCategory field is still updated to "Other" (as in the "Else" line) instead of "EPA" as it should be.

Any suggestions why the ElseIf statements are not being evaluated as True?
 
Try:

Me.TribeOrgName =
 
l,

Check the SQL RowSource for your combo and substitute
it for the "????". The order starts at 0 (0,1,2,3 ...).

Code:
If (Me![TribeOrgName].Column(0) < 1000) Then
   Me![InstrCategory] = "TRIBAL"
ElseIf (Me!TribeOrgName.Column(????) = "US EPA") Then
   Me![InstrCategory] = "EPA"
ElseIf (Me!TribeOrgName.Column(????) = "US EPA OAQPS") Then
   Me![InstrCategory] = "EPA"
Else
   Me![InstrCategory] = "Other"
End If

Wayne
 

Users who are viewing this thread

Back
Top Bottom