Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ActiveX Control: DTPicker

Posted on 2002-05-06
8
Medium Priority
?
832 Views
Last Modified: 2012-08-14
1. Is it possible to set Min and Max dates thru code? If Yes, how?

2. I'd like to lock the typing capability and allow user to select the date only thru the drop-down calender. Tried locking the control but didnt help

thanks in advance
0
Comment
Question by:aawasthi001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
8 Comments
 
LVL 12

Expert Comment

by:Paurths
ID: 6991322
u can set the min and max date by selecting the datepicker,
right-click on it and select datepicker-object --> properties (not the default properties window for all controls)
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6991326
oops, overlooked the second part...

here is an example of disabling user typing into datepicker:
--> name of my control is dteP

Private Sub dteP_KeyPress(KeyAscii As Integer)

    KeyAscii = 0

End Sub

cheers
Ricky
0
 

Author Comment

by:aawasthi001
ID: 6991813
Paurths:
thanks for the Ascii-function. As for the min, max dates thru properties, I already know that. My question is, is it possible to change them thru code? Each user depending on his/her level would have a different set of dates.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 12

Expert Comment

by:Paurths
ID: 6994185
hi,

quite simple actually,



dteP.MinDate = #1/1/02#
dteP.MaxDate = #1/1/03#


cheers
Ricky
0
 

Author Comment

by:aawasthi001
ID: 6995554
Paurths:

DTPicker neither has Key_Press-Event nor one can access its properties. Please try it out.

If you have a workable example, then email me.

aawasthi001@yahoo.com
0
 
LVL 12

Accepted Solution

by:
Paurths earned 200 total points
ID: 6995677
sure it has...

the only thing is, this is an ActiveX-control,
so Access will not show u all its properties (it has an OCX-property-page of itself), but the properties are there...

In your module (or VB-editor in Acc2k) in the left upper combobox, select the name of the DatePicker,
then in the right combobox u will have all its properties.
Key_Press is one of them.

MIN- and MAXDate are methods, so they will not show,
but if u type them they will work.

anyway, an example is on its way

cheers
Ricky
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6996616
strange,

i commented here this morning,
my post is gone...

anyway,

what i said:
since this is an ActiveX control, u wont see all the properties in the enumeration-box, since it has a 'ocx-property-page.

but the methods and properties are there.

for example:
in the code-window (Visual basic editor in A2k), in the left upper corner, u will find your datepicker (name) in the combobox, if u select it,
then u will find the properties in the combobox in the right upper corner.

cheers
Ricky
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6996618
oops,

long day..... hehe

thanx for the A

cheers
Ricky
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question