andy_dyer
Registered User.
- Local time
- Today, 03:48
- Joined
- Jul 2, 2003
- Messages
- 806
Hi,
I have a database with a dynamic subform (sfrdata) which displays different subforms when menu buttons are clicked
When I open one subform I want it to check if I have a date in EITHER of two date fields which are on different subforms. If they are both blank I want it to display a message box, if I have a date in either then that is fine.
But I've treid lots of different combinations but it doesn't matter if I have a date in both, neither or either of the fields I get my message box triggered...
Why???
I have a database with a dynamic subform (sfrdata) which displays different subforms when menu buttons are clicked
When I open one subform I want it to check if I have a date in EITHER of two date fields which are on different subforms. If they are both blank I want it to display a message box, if I have a date in either then that is fine.
But I've treid lots of different combinations but it doesn't matter if I have a date in both, neither or either of the fields I get my message box triggered...
Why???
Code:
Private Sub Form_Load()
On Error Resume Next ' We have to go through with this come what may!
Dim Answer As Integer
If IsNull(Forms![frmprojectmaster]!sfrData!txtStartDate) And IsNull(Forms![frmprojectmaster]!sfrData!txtProposedProjectStartDate) Then
Answer = MsgBox("Please enter either a Project Start Date on the 'General' tab or a Proposed Start Date on the 'Funding Application' tab", vbOKOnly, "Please enter a Start Date")
Else
End If
End Sub