Solved

ActiveX Control: DTPicker

Posted on 2002-05-06
8
813 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
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.

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

Suggested Solutions

Title # Comments Views Activity
Reference theme colors in VBA 4 24
making call from microsoft access to skype for business 5 44
Launch app from Access custom ribbon 8 33
Combobox row source 2 20
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

776 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