Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the user pick up a date from the calendar and returns that value to
the txt1stDistStart. I wanted to validate that the date selected is less or equal to the Effective Date (txtEffdate) if not I wanted to return to the Distribution Field (txt1stDistStart) but I keep getting run-time erro 438 - Object doesn't support this property or method. Where did I go wrong? Private Sub txt1stDistStart_Change() If Me.txt1stDistStart Me.txtEffDate Then MsgBox "1st Distribution Is Greater Than Start Date" Sheets("Promo Request Form").Activate Me.txt1stDistEnd.ActiveControl Me.txt1stDistStart.SetFocus Else Me.txt1stDistEnd.SetFocus End If End Sub Thank You |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
look at this see if it something you can change for your needs
If DTPStartDate.Value DTPEndDate.Value Then MsgBox "Start Date Can not be greater then End Date", vbCritical, Exit Sub 'get out End If ' your code here if DTPStartDate.Value is less than 'DTPEndDate.Value you should be able to add .value to txt1stDistStart.value "mmmbl" wrote: I have the user pick up a date from the calendar and returns that value to the txt1stDistStart. I wanted to validate that the date selected is less or equal to the Effective Date (txtEffdate) if not I wanted to return to the Distribution Field (txt1stDistStart) but I keep getting run-time erro 438 - Object doesn't support this property or method. Where did I go wrong? Private Sub txt1stDistStart_Change() If Me.txt1stDistStart Me.txtEffDate Then MsgBox "1st Distribution Is Greater Than Start Date" Sheets("Promo Request Form").Activate Me.txt1stDistEnd.ActiveControl Me.txt1stDistStart.SetFocus Else Me.txt1stDistEnd.SetFocus End If End Sub Thank You |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I did something different from your proposal but this one also worked. I have
to make the calendar pop-up again so the user can choose another date. Thanks for the reply. "Mike" wrote: look at this see if it something you can change for your needs If DTPStartDate.Value DTPEndDate.Value Then MsgBox "Start Date Can not be greater then End Date", vbCritical, Exit Sub 'get out End If ' your code here if DTPStartDate.Value is less than 'DTPEndDate.Value you should be able to add .value to txt1stDistStart.value "mmmbl" wrote: I have the user pick up a date from the calendar and returns that value to the txt1stDistStart. I wanted to validate that the date selected is less or equal to the Effective Date (txtEffdate) if not I wanted to return to the Distribution Field (txt1stDistStart) but I keep getting run-time erro 438 - Object doesn't support this property or method. Where did I go wrong? Private Sub txt1stDistStart_Change() If Me.txt1stDistStart Me.txtEffDate Then MsgBox "1st Distribution Is Greater Than Start Date" Sheets("Promo Request Form").Activate Me.txt1stDistEnd.ActiveControl Me.txt1stDistStart.SetFocus Else Me.txt1stDistEnd.SetFocus End If End Sub Thank You |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run Time Error 1004: Application or Object Defined Error | Excel Programming | |||
Run Time 1004 Error: Application or Object Difine Error | Excel Programming | |||
Conditional Formatting - Run Time Error '13' Type Mismatch Error | Excel Programming | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming | |||
Befuddled with For Next Loop ------ Run - Time Error '13' Type Mismatch Error | Excel Programming |