J
Jerry
I'm a novice in VB, so please bear with me.
The following code is set asan "after update" for
my "Grade" field. When it's run, I get a "label not
defined" error, and it highlights "GoTo IfNull"
indicating that's where the error is. I'm sure it's
obvious to the experienced, but I can't see the problem.
What the routine does is this: If the grade you enter
is "S", then it will increment the Superiors number by
one. If you enter something other than "S" it takes the
number in the Superiors field, if there is one, and
deletes it (sets it to null).
Private Sub Grade_AfterUpdate()
Dim TempGrade As String
Dim TempSuperior As Integer
TempGrade = Me.Grade
If Me.Superiors = Null Then GoTo IfNull Else GoTo
IsNotNull
IsNotNull:
TempSuperior = Me.Superiors
If [TempGrade] <> "S" Then Me.Superiors = Null
If [TempGrade] = "S" Then Me.Superiors = TempSuperior
+ 1
End Sub
IfNull:
TempSuperior = 0
If [TempGrade] <> "S" Then Me.[Superiors] = Null
If [TempGrade] = "S" Then Me.[Superiors] =
TempSuperior + 1
End Sub
The following code is set asan "after update" for
my "Grade" field. When it's run, I get a "label not
defined" error, and it highlights "GoTo IfNull"
indicating that's where the error is. I'm sure it's
obvious to the experienced, but I can't see the problem.
What the routine does is this: If the grade you enter
is "S", then it will increment the Superiors number by
one. If you enter something other than "S" it takes the
number in the Superiors field, if there is one, and
deletes it (sets it to null).
Private Sub Grade_AfterUpdate()
Dim TempGrade As String
Dim TempSuperior As Integer
TempGrade = Me.Grade
If Me.Superiors = Null Then GoTo IfNull Else GoTo
IsNotNull
IsNotNull:
TempSuperior = Me.Superiors
If [TempGrade] <> "S" Then Me.Superiors = Null
If [TempGrade] = "S" Then Me.Superiors = TempSuperior
+ 1
End Sub
IfNull:
TempSuperior = 0
If [TempGrade] <> "S" Then Me.[Superiors] = Null
If [TempGrade] = "S" Then Me.[Superiors] =
TempSuperior + 1
End Sub