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

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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