Link to home
Start Free TrialLog in
Avatar of Evan Cutler
Evan CutlerFlag for United States of America

asked on

Breaking Date Field by 3 textfields for "filter by form"

I have a form in Access, where I do "Filter By Form".
No issues there...but I'm being asked to enhance it.

One of the fields is a date field.  To search a "Month", I put in

Between #1/1/2011# and #1/31/2011#

To get January 2011.

Can I split the date field textboxes up to 3 fields, and still keep control with a single date filed, while searching by the 3 fields?  This way, if I do a "Filter by Form" I can use a textbox or combo box on it?

thanks.
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Perhaps a better idea would be to have a table of months, say tbl_months, with columns of txt_formal_name (i.e. January 2011), dt_start (i.e. 1/1/2011 12:00 AM), and dt_end (i.e. 1/31/2011 11:59:59 PM).

Then, create a combo box with the txt_formal_name column visible, and everything else.

Then, when the user selects a value, pass along the dt_start and dt_end columns in your 'Between' expression.
Avatar of Evan Cutler

ASKER

Another thought is to repeat the field three times, then just filter out the value partial I want for each one.

Can I do that?
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is a good solution...I will work towards my goal with this solution.

My issue is that if I adjust the DatePart, the date field does not get updated....
but it's a good start. :)

Thanks.