Logical Problem - quick/easy to solve

P

Paul

Well and quick/easy to solve for you. I can't think or
understand how to do this.

A variable is called 'newage' representing a persons age

I have an age group for 21 to 25 Yr Olds. I want an if
stagement saying if 'newage' is not in between 21 and 25
then msgbox "False"

So far I have (that doesnt work):

If Me![AgeGroup] = "21-25" And Not newage > 20 And Not
newage < 25 Then MsgBox "You Cannot Enter This Person
Into This Event As The Entrant Is " & newage & " Years
Old And This Event Is For Entrants Between The Ages Of 21
To 25"
 
H

Howard Brody

If [AgeGroup] <> "21-25" Then
Exit Sub
End If

If newage < 21 or newage > 25 then
MsgBox "You Cannot Enter This Person " _
& "Into This Event As The Entrant Is " _
& newage & " Years Old And This Event " _
& "Is For Entrants Between The Ages " _
& "Of 21 To 25."
End If

Hope this helps!

Howard Brody
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top