Day Month Year selection on form.

Pavl

Registered User.
Local time
Today, 14:27
Joined
Jan 17, 2013
Messages
56
Complete beginner with accd2010. Forms to display historical records, one needs to be filtered by date. I have seen the excellent datepicker from "pkstormy" but want another more compact method. And I am only using a 3 year range.

Have created dateserials (in Excel) for the range I am using and then imported to db and have used a query to create [TableYMDextract] with fields for year, month and days [DayExtract] that are correct for months and leap/non years (number fields). Have included fields for shortdate [DateSequence] and dateserial [DateNumber] and ID.

On [MyForm] have [ComboYear] and [ComboMonth] which populate [TxtYear] and[TxtMonth].
Now I want to put the correct day numbers into [ComboDay] so that the user can select from this combo and so populate [TxtDay].

Then want to OnClick a command button to filter the form for Equal/Before/After using values concatenated from the textboxes on field [DateUp].

Prepared to change method and have found _
Me.cboDay.RowSource = "SELECT Number "_
& "FROM MyNumbersTable " & "WHERE Number < = "_
& Day(DateSerial(Me.cboYear,Me.cboMonth+1,0))
Where MyNumbersTable is a table of integers
But do not know how to implement this.

Trying to run before I can walk ?
 
Last edited:
In the absence of any suggestions I have used the Neanderthal approach.
Used table list of dates and stuffed values into combobox. Used as a record selector with next/previous/first/last buttons as well.
It works and is robust and easy for the "users".
Seems as though a lot of people have problems with a decent date selector - the ActiveX thing or the date picker are not liked and in some cases seem to be more hassle than useful.. (According to various other forums).
No-one seems to have a decent answer (with apologies to "pkstormy") for anything small/compact and that requires dates a long way from current date.
 
And a further update.
When transferring to a machine with runtime (and having sorted out the Trusted Location registry). It turns out that use of "Microsoft Windows Common Controls 6.0" causes error with missing/broken reference to "mscomct2.ocx".

Apparently the ActiveX stuff causes a headache if the runtime machine does not have the correct file.
Unchecking MSWCC 6 solved the problem.

So "pkstormy" still has the best version (non ActiveX).
 
And.......

See this version for a non ActiveX version.

As no links allowed - translate this and you will find.

sites DOT google DOT com SLASH site SLASH e90e50 SLASH calendar-control-class

Have not tried it but looks good.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom