Microsoft's Date & Time Picker (Calander) control 6 (SP4

Logistix

Board Regular
Joined
Aug 23, 2006
Messages
77
Hi,

I'm trying to get an error message to popup when no date has checked/ticked. Except the problem is the error message never pops up!

The code I have relating to my DTPick1 control are:

Code:
Private Sub UserForm_Activate()

    Sheets("Records").Select
    Worksheets("Records").Range("Start").End(xlDown).Select
    
    EmployeeNameBox = ""
    DTPicker1.Value = ""
    HoursDepositBox = ""
    Timesheethoursbox = ""
    Selection.Offset(1, 4) = ""

End Sub

And

Code:
 Private Sub NextForm_Click()
 
  Dim MoveForward As Boolean
  Dim Boxx As String
  
  MoveForward = True
  If EmployeeNameBox = "" Then
  
    MsgBox ("You have not selected an employee name")
    MoveForward = False
    Boxx = "EmployeeNameBox"
     
  ElseIf DTPicker1.Value = "" Then     *** The problem seems to be here somewhere
  
    MsgBox ("You have not selected an date")
    MoveForward = False
    Boxx = "DTPicker1"

end if

Does anyone have some experience with this date control and see where/how I'm going wrong?? Thank you
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,214,945
Messages
6,122,397
Members
449,081
Latest member
JAMES KECULAH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top