Allen
I have tryed your suggestion but can't seen to get it to work. This is what
I have
I have a Form called frmAddExamToDivision this form has 4 fields called
CourseName, DivisionName, StartDate, FinishDate and a Subform called
frmAddExamToDivisionSubform.
The frmAddExamToDivisionSubform has 3 field called ExamName, ExamDate,
InstructorDetails.
I have tryed this but no luck
Private Sub Form_BeforeUpdate(Cancel As Integer)
If (Me.ExamDate < Me.StartDate) Or _
(Me.ExamDate > Me.FinishDate) Then
Cancel = True
MsgBox "Exam must be during the course." & vbCrLf & _
"Correct the entry, or press <Esc> to undo."
End If
End Sub
and this
Private Sub Form_BeforeUpdate(Cancel As Integer)
If
(Me.Forms.frmAddExamToDivision.frmAddExamtoDivisionSubform.Form.ExamDate
< Me.Forms.frmAddExamToDivision.StartDate) Or _
(Me.Forms.frmAddExamToDivision.frmAddExamtoDivisionSubform.Form.ExamDate
> Me.Forms.frmAddExamToDivisionFinishDate) Then
Cancel = True
MsgBox "Exam must be during the course." & vbCrLf & _
"Correct the entry, or press <Esc> to undo."
End If
End Sub
and still no luck
Can you please lend some more assistance
Thank you
Rodney
> Allen,
> Thank you so much for this and I see what you mean with the BeforeUpdate.
[quoted text clipped - 30 lines]
> > > Thank you
> > > Rodney
Allen Browne - 13 Jul 2006 05:23 GMT
In the subform's module, refer to the text boxes on the parent form as:
Me.Parent.ExamDate
Me.Parent.StartDate

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Allen
> I have tryed your suggestion but can't seen to get it to work. This is
[quoted text clipped - 76 lines]
>> > > Thank you
>> > > Rodney