PDA

View Full Version : Datepicker Null value.



shahcu
03-22-2007, 10:52 PM
Hi!

I wud like to use a Datepicker in a userform. I have created a form and inserted a datepicker component. However when I run that open the date picker contains a date value. What I need is when user opens a form he will get blank and as and when he clicked on the Datepicker then only he will able to select the date.

Pls help.:(

shahcu
03-23-2007, 01:43 AM
Pls help

Aussiebear
03-23-2007, 03:51 AM
I'm assuming that you have the userform setup, but for this to work you'll need to add both a command button and a textbox. Double click on the commandbutton1, make the code read


Private Sub Commandbutton1_Click()
Textbox.text = getUserDate(Date)
End Sub

shahcu
03-23-2007, 04:01 AM
Hi!

Thank u very much for ur time and support.

when i tried this I got an error message:

"Complie Error : Sub or function not defined"

getUserDate

I have putting it like this in user form :

Private Sub CommandButton3_Click()
TextBox13.Text = getUserDate(Date)
End Sub


I would also like you to know that am trying to insert a date picker... I am able to do that using the following code:

ActiveSheet.Cells(r, 2) = DTPicker1.Value

It helps me to store the value in excel sheet... The only thing what I need is that when gets open up the user will get null or blank value in Date picker instead of any date. As Datepicker takes the date value by its own.

Aussiebear
03-23-2007, 04:31 AM
Do you have Option Explicit used at the top of the code page?

shahcu
03-23-2007, 04:43 AM
Nops!

I have tried that as well no go..

Pls assist.

Bob Phillips
03-23-2007, 04:59 AM
Sewt the CheckBox property to True.

shahcu
03-23-2007, 05:54 AM
:( done but no go...

Bob Phillips
03-23-2007, 06:29 AM
You can set the value to null then.