Veronica316
MIS
Hello Everyone,
I'm trying to include this bit of code to check if the person's age is that of a child or an Adult, but it is not working (in an MS Access form), could you please advise me of how to do this as I'm a beginner when it comes to VBA (I can send you the DB if you wish)...
==============================
Private Sub memberTypeCB_Change()
Dim age As Integer
age = Int((date - Me.DOBTxt) / 365)
If age > 5 Then
Me.memberTypeCB = child
ElseIf age < 18 Then
Me.memberTypeCB = child
Else: MsgBox "Please select child subription as this person is between 5 and 18 years old"
End If
End Sub
============================
Is there anyway to do this so when I press a button on a form to enter a record it can check if the person's age is greater than 5 and less than 18 ?. Any help is greatly appreciated, thanks in advance.
Kind Regards,
Veronica
message_4_u2001@yahoo.com
I'm trying to include this bit of code to check if the person's age is that of a child or an Adult, but it is not working (in an MS Access form), could you please advise me of how to do this as I'm a beginner when it comes to VBA (I can send you the DB if you wish)...
==============================
Private Sub memberTypeCB_Change()
Dim age As Integer
age = Int((date - Me.DOBTxt) / 365)
If age > 5 Then
Me.memberTypeCB = child
ElseIf age < 18 Then
Me.memberTypeCB = child
Else: MsgBox "Please select child subription as this person is between 5 and 18 years old"
End If
End Sub
============================
Is there anyway to do this so when I press a button on a form to enter a record it can check if the person's age is greater than 5 and less than 18 ?. Any help is greatly appreciated, thanks in advance.
Kind Regards,
Veronica
message_4_u2001@yahoo.com