PDA

View Full Version : Solved: logic help



benong
09-15-2010, 09:10 PM
hi,
i want to validate the date in correct format:
- the date is numeric
- the date is 8 digits in length
- the date is not empty.
But i have problems with the logic below:


Do
rDate = InputBox("Input date (yyyymmdd)")
Loop While rDate <> "" And Len(rDate) <> 8 And IsNumeric(rDate)
Pls advise, thanks.

Bob Phillips
09-16-2010, 03:46 AM
Do
rDate = InputBox("Input date (yyyymmdd)")
Loop While rDate = "" Or Len(rDate) <> 8 Or Not IsNumeric(rDate)

benong
09-16-2010, 05:20 PM
Dear xld,
many thanks, it works perfectly :)