A
Andrew R
....or so it seems.
I have a procedure behind the Current event of a form. The full code is
at the bottom of this post in case it sheds any light, though I can't
for the life of me spot anything myself.
The problem I have is that at the following line of code:
--
If txtEnrolled.Value < (lngMaxSize - 2) Then
--
the procedure always seems to drop to break mode. There's no error
message, but the line gets highlighted in the traditional way, as
though there was a problem. However, pressing F5 or F8 causes the code
to continue to execute with no errors, and it does exactly what I
wanted.
In short, the effect is of me having put a break point (there isn't one
- and I don't think there ever was on this line) or written
debug.assert false or similar, which is also not the case, as you can
see.
Does anyone have any suggestions? Am I being totally stupid?!
Thanks for your help
Regards
Andrew
With cboCourseID
.SetFocus
txtCourseHeader = .Text
End With
If IsNull(txtContractor) Then
txtContractor.Visible = False
txtInstructor.Visible = True
Else
txtContractor.Visible = True
txtInstructor.Visible = False
End If
txtEnrolled = Me.ChildForm.Form.RecordsetClone.RecordCount
If txtEnrolled.Value < (lngMaxSize - 2) Then
lblWarnings.Visible = False
ElseIf txtEnrolled.Value >= (lngMaxSize.Value - 2) And lngMaxSize.Value
.Caption = "Event approaching capacity"
.Visible = True
End With
Else
With lblWarnings
.Caption = "EVENT FULL"
.Visible = True
End With
End If
I have a procedure behind the Current event of a form. The full code is
at the bottom of this post in case it sheds any light, though I can't
for the life of me spot anything myself.
The problem I have is that at the following line of code:
--
If txtEnrolled.Value < (lngMaxSize - 2) Then
--
the procedure always seems to drop to break mode. There's no error
message, but the line gets highlighted in the traditional way, as
though there was a problem. However, pressing F5 or F8 causes the code
to continue to execute with no errors, and it does exactly what I
wanted.
In short, the effect is of me having put a break point (there isn't one
- and I don't think there ever was on this line) or written
debug.assert false or similar, which is also not the case, as you can
see.
Does anyone have any suggestions? Am I being totally stupid?!
Thanks for your help
Regards
Andrew
With cboCourseID
.SetFocus
txtCourseHeader = .Text
End With
If IsNull(txtContractor) Then
txtContractor.Visible = False
txtInstructor.Visible = True
Else
txtContractor.Visible = True
txtInstructor.Visible = False
End If
txtEnrolled = Me.ChildForm.Form.RecordsetClone.RecordCount
If txtEnrolled.Value < (lngMaxSize - 2) Then
lblWarnings.Visible = False
ElseIf txtEnrolled.Value >= (lngMaxSize.Value - 2) And lngMaxSize.Value
With lblWarningstxtEnrolled.Value Then
.Caption = "Event approaching capacity"
.Visible = True
End With
Else
With lblWarnings
.Caption = "EVENT FULL"
.Visible = True
End With
End If