Russ
First of all, if you use a Value List to provide the # of days, you will
need to return to the value list to make any changes. If you use a small
lookup table instead, you can make any changes directly in that table.
Secondly, your original expression used the "Now()" function, which returns
a date AND time value, not just a date. If you need only a date, consider
using the "Date()" function instead.
Third, it sounds like you wish to use the number of days past to find
records (?Transactions) that have happened since that point -- if so, you
don't need to use the Between ... And ... expression. You could use a
simpler expression as a query criterion for that TransactionDate field:
<Date() - [Forms]![frmTransactions]![cboFrequency]
Finally, if you want to select all records, regardless of TransactionDate
(i.e., no selection criterion), one approach might be to dynamically create
a SQL statement that returns your rows. Behind a button click on this form,
you'd build a SQL statement that included a "WHERE" clause if there was a
value in the combo box, and excluded the "WHERE" clause if the combobox was
null. This way, you wouldn't need the underlying query.
--
Regards
Jeff Boyce
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
Microsoft Registered Partner
https://partner.microsoft.com/
Russ via AccessMonster.com said:
Jeff
How would I get the show all to work like a wild card "*" in the criteria?
Show ALL;1;7;14;30;60;90;120;150;180;210;240;270;300
When the show all is selected all transactions will show up, no matter what
the date is.
Any help would be great!
Thanks
Russ
Jeff said:
Russ
I'm not sure I'm following what you want to have happen... you've described
a way to do something, (add a "Show All"), but not what the end result would
be.
Are you saying you want a way to have a query that returns all records,
regardless of TransactionDate? Only those in the future?
Looking for help.
Want to use a combo box to set number of days to show for my query.
[quoted text clipped - 10 lines]