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

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Ivan F Moala

MrExcel MVP
Joined
Feb 10, 2002
Messages
4,209
DTPicker1.Value is expecting a Values and NOT a null String

use 0 instead of ""
 

Forum statistics

Threads
1,136,991
Messages
5,679,014
Members
419,799
Latest member
APInfa

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
Top