Solved

ActiveX Control: DTPicker

Posted on 2002-05-06
8
811 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
  • 6
  • 2
8 Comments
 
LVL 12

Expert Comment

by:Paurths
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 12

Expert Comment

by:Paurths
Comment Utility
hi,

quite simple actually,



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


cheers
Ricky
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:aawasthi001
Comment Utility
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 50 total points
Comment Utility
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
Comment Utility
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
Comment Utility
oops,

long day..... hehe

thanx for the A

cheers
Ricky
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now