Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a form with two textboxes for entering a date range. When the user clicks OK on the form, i validate that the texboxes are dates... this works fine... then I want to check that the from date is not greater than the to date, but it is not working consitently. My message is returning that my from date is greater that my to date even when it isn't. sample code: If Not IsDate(tbxFrom_Date.Value) Then MsgBox "The value entered in the From Date field is not a valid Date" tbxFrom_Date.SetFocus ElseIf Not IsDate(tbxTo_Date.Value) Then MsgBox "The value entered in the To Date field is not a valid Date" tbxTo_Date.SetFocus ElseIf tbxFrom_Date tbxTo_Date Then MsgBox "The From Date is greater than the To Date. Please change. " & _ tbxFrom_Date.Value & " - " & tbxTo_Date.Value tbxFrom_Date.SetFocus tbxFrom_Date.Value = "" Else 'MsgBox "all good" Unload Me End If when I read at my resulting message, the from date is definitely less than the to date... ideas? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
problems editing data range | Excel Discussion (Misc queries) | |||
Range name problems | Excel Discussion (Misc queries) | |||
Range problems... | Excel Programming | |||
Range problems | Excel Programming | |||
Variables and range problems | Excel Programming |