Active X controls Date/Time Picker

beckie1234

Struggling Student
Local time
Today, 13:22
Joined
Mar 10, 2007
Messages
94
I have two boxes on my form that use Microsoft Date/Time picker. A begin date and an end date. How do I make sure that those controls work no matter what computer the program is run from?
 
About the ONLY way I know of to guarantee it is available, is the way that I got to work, was to create a little tiny program in VB6 which has the control on a form. Then, create the program installation and install it. Then, the control was available on the machine as well as not having to worry about references since it got registered when it was installed.
 
How would I go about doing that if this form is on a DB that is on a network and needs to be available on any computer it is accessed from? The form I created is suppose to be as easy as possible. All reports and charts are run from buttons. I need a way to have the user pick dates to run the reports from and this morning the form was having a problem opening on a different computer. What do you suggest?
 
I would suggest getting rid of the date/time picker and go to this:
http://www.access-programmers.co.uk/forums/showthread.php?t=103387

I've found that it returns the date in UK format, I just make sure to have the extra bit of code when calling it to be something like:
PopupCalendar Me.txtDate
Me.txtDate = Format(Me.txtDate, "mm/dd/yyyy")

So, if you import the form "frm_zsfrmCalendar" and the code module basCalendar from that sample in the link above, you can put a button to select the date, it pops up and puts it in your text box. All without an ActiveX control.
 
Will that work for a begin and end date? The date is the criteria to run the queries that run the reports.
 
Yep, in fact if you put the code to call the popup in the double-click event of each of the text boxes, you don't even need a button. Just remember to specify which control you are wanting filled in it's event:
So, in the event of txtBegDate:
Code:
PopupCalendar Me.txtBegDate

and in the event of txtEndDate:
Code:
PopupCalendar Me.txtEndDate
 
Will that work for a begin and end date? The date is the criteria to run the queries that run the reports.

I use this little pop-up calendar on most of my programs and it works like a charm for entry and reference. No Active-X controls needed.
 
Ok obviously I am not getting it because when I try to run it (just the form not on the actual form that produces the reports) after I imported it all I get is The expression On Open you entered as he vent property setting produce the following error: User defiend type not defined.

So what is my little pea brain missing here.
 
1. You have to have imported the two objects I mentioned previously:
frm_zsfrmCalendar and basCalendar

2. You just put code in your own form (don't open the calendar form yourself):
Code:
PopupCalendar Me.txtBegDate
And change txtBegDate to whatever textbox name your control is.
 
Try putting the below code in the event that you want to load the date. I put this in the double-Click event of the textbox that holds the date on my form. That way, the user has to double-click the date on the calendar to get it to transfer to the textbox on the form.

So, they would double-click in the textbox and pull up the calendar, then double-click on the date to make the entry.

Code:
=PopupCalendar(Screen.ActiveControl)

Note: put this code directly in the box next to the event.
 

Users who are viewing this thread

Back
Top Bottom