| View previous topic :: View next topic |
| Author |
Message |
Dragona Newbie
Joined: 11 Dec 2003 Posts: 7
|
Posted: Dec 16th, 2003 06:21 AM Post subject: A To Z |
|
|
hi im doing a select case statement so that it will only alow numbers 1 to 49 in but for some reason it wont block here is the code
| Code: |
Select Case Val(txtnum(i).Text)
Case 1 To 49
intflag1 = 0
frmLottow1.Hide
frmLottow2.Show
MsgBox "Please only enter numbrs from 1 to 49"
Case Else
intflag1 = 1
End Select
Next i
If intflag1 = 0 Then
frmLottow1.Hide
frmLottow2.Show
ElseIf intflag1 = 1 Then
frmLottow1.Show
MsgBox "Only enter numbers 1 - 49"
Exit Sub
End If
|
i know i need to tidy up my code and shortent it buy not using those if statements
but ne wayz i think that should be blocking apha characters getting through but it doesnt. i worked out a way but thats on a computer miles away
ive also tried this but it wants a and z to be a variable
| Code: |
Select Case Val(txtnum(i).Text)
Case 1 To 49
intflag1 = 0
frmLottow1.Hide
frmLottow2.Show
Case A To z
intflag1 = 1
MsgBox "Please only enter numbrs from 1 to 49"
Case Else
intflag1 = 1
End Select
Next i
If intflag1 = 0 Then
frmLottow1.Hide
frmLottow2.Show
ElseIf intflag1 = 1 Then
frmLottow1.Show
MsgBox "Only enter numbers 1 - 49"
Exit Sub
End If
|
_________________
:O  |
|
| Back to top |
|
Avis Junior Poster

Joined: 07 Oct 2003 Posts: 510 Location: India
|
|
| Back to top |
|
|