RUN-TIME ERROR 438

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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.
 

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

Similar Threads


Back
Top