Date Picker Control

S

Sam

I have had trouble utilizing the Calendar control when the end user does not
have Access installed on their PC. Does the Date Picker control have the same
limitation?It's difficult to test since I do have Access in my Office bundle.

Thanks,

Sam
 
J

Jacob Skaria

DatePicker comes along with Visual Studio; which again may not be in the user
machine.

If this post helps click Yes
 
J

Jacob Skaria

Sam, you can try a custom date/time picker such as below. Try this out using
a textbox control in a userform.

Private Sub UserForm_Activate()
Me.TextBox1 = Format(Now, "dd-mmm-yyyy hh:mm")
End Sub

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal
Shift As Integer)
'Date and Time Picker Use down/up arrow to change date/time.
Dim intPos As Integer, strType As String
If KeyCode = 38 Or KeyCode = 40 Then
intPos = Me.TextBox1.SelStart
strType = Application.Lookup(intPos, _
Array(0, 3, 7, 12, 15), Array("d", "m", "yyyy", "h", "n"))
Me.TextBox1 = Format(DateAdd(strType, _
(39 - KeyCode), TextBox1), "dd-mmm-yyyy hh:mm")
KeyCode = 0
Me.TextBox1.SelStart = intPos
End If
End Sub


If this post helps click Yes
 
L

Lemi

Hi Sam,

I had the same problem and solved as follows:

-You need to find MSCOMCT2.OCX file
-Copy it under Windows\System32 if it is not already there
-Manually register it by Run under Start menu, writing:
regsvr32 MSCOMCT2.OCX and click OK
-You should see the message something like "...successfuly registered"

When you open the Excel next time you should be able to find DatePicker
controls under Additional Controls.

See if this helps.

Rgds,
Lemi
 

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

Top