Hi there people,
I want to make sure my user fills in a particular control (duration) on a continous record subform (interactionssubform) within my form. The subform is on another page if that has any implications....
I just want to stop them going to a new or another record until they have entered some data into duration on the subform....I already have some code in the BeforeUpdate of my main form to make sure the user does not leave a field 'Registrationdate' (on the main form) empty......can I just put some more similar code into the same event as below?.....which doesn't seem to work for me...or is there more to it than that?
Private Sub Registrationdate_BeforeUpdate(Cancel As Integer)
If Trim(Me.Registrationdate & "") = "" Then
MsgBox "Please enter a Registration Date for this client. Thank you."
Cancel = True
End If
If Trim(Forms!Interactionssubform!Me.Duration & "") = "" Then
MsgBox "Please enter a duration for this client. Thank you."
Cancel = True
End If
End Sub
Can you do that...have two If Then thingys in one event of a form?
Am I on the right track or completely off the ball? ? ? ?
Still haven't had any time to learn this stuff...just getting by....
Thanks for any help.
Andrew.
I want to make sure my user fills in a particular control (duration) on a continous record subform (interactionssubform) within my form. The subform is on another page if that has any implications....
I just want to stop them going to a new or another record until they have entered some data into duration on the subform....I already have some code in the BeforeUpdate of my main form to make sure the user does not leave a field 'Registrationdate' (on the main form) empty......can I just put some more similar code into the same event as below?.....which doesn't seem to work for me...or is there more to it than that?
Private Sub Registrationdate_BeforeUpdate(Cancel As Integer)
If Trim(Me.Registrationdate & "") = "" Then
MsgBox "Please enter a Registration Date for this client. Thank you."
Cancel = True
End If
If Trim(Forms!Interactionssubform!Me.Duration & "") = "" Then
MsgBox "Please enter a duration for this client. Thank you."
Cancel = True
End If
End Sub
Can you do that...have two If Then thingys in one event of a form?
Am I on the right track or completely off the ball? ? ? ?
Still haven't had any time to learn this stuff...just getting by....
Thanks for any help.
Andrew.