-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Your question appears to be "How can I have the results of TextBox
IVMark take precedence over the results of TextBox Mark?" Correct?
One method would be to create a module variable that will be set/reset
by TextBox IVMark. E.g.:
Declaration section:
Dim m_blnIVMark_Set As Boolean
- -------
Private Sub IVMark_AfterUpdate()
m_blnIVMark_Set = Not IsNull(Me!IVMark)
... other code that sets Pass/Re-sit values ...
End Sub
Private Sub Mark_AfterUpdate()
If m_blnIVMark_Set Then Exit Sub
... etc. ...
End Sub
Another method: in the IVMark AfterUpdate event you could disable the
TextBox Mark after a valid datum has been entered into the IVMark
TextBox:
If Not IsNull(Me!IVMark) Then
Me!Mark = "" ' Clear the value first
Me!Mark.Enabled = False
' ... continue by setting the Pass/Re-sit values ...
End If
HTH,
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBP+ixtIechKqOuFEgEQJ/KACgyBs9BartRH1JUlEqTR+RQsiVg3QAoIlf
RoAO/j/wrhYdJkAFf2RpgZaf
=pNzT
-----END PGP SIGNATURE-----
Terry wrote:
The following code (VB6) automatically sets ticks or null values for
Check Boxes: 'Pass' and/or 'Resit', depending on the data entered in
the 'ModuleID' and 'Mark' Text Boxes.
'ModuleID' is a Text Box which records the module number of the exam.
Module 1 has a pass mark of 27 and modules 2-7 have a pass mark of 24.
Private Sub Mark_AfterUpdate()
Dim intPassMark As Integer
If Me.[ModuleID] = 1 Then
intPassMark = 27
Else
intPassMark = 24
End If
If IsNull(Me.Mark) Then
Me.Pass = False
Me.Resit = False
Else
Me.Pass = (Me.Mark >= intPassMark)
Me.Resit = Not Me.Pass
End If
End Sub
This works fine:-)
I also have a control 'IVMark', (Text Box which is used to record
secondary marking results), and need it to override the above code if
marks are found to be below the pass mark.
Can you help?