Solved

ActiveX Control: DTPicker

Posted on 2002-05-06
8
812 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
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
 
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
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

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 50 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server views 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 Microsoft Access…
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…

863 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

20 Experts available now in Live!

Get 1:1 Help Now