Solved

ActiveX Control: DTPicker

Posted on 2002-05-06
8
825 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

624 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