using combo box to set number of days in a query question

  • Thread starter Thread starter Russ via AccessMonster.com
  • Start date Start date
R

Russ via AccessMonster.com

Looking for help.
Want to use a combo box to set number of days to show for my query.
Example;
Transaction Date = Between Now() And Now()-[Forms]![frmTransactions]!
[cboFrequincy]
have a combo bot set up as follows
Value List
1;7;14;30;60;90;120;150;180;210;240;270;300
but want to have an Show ALL in there like this
Show ALL;1;7;14;30;60;90;120;150;180;210;240;270;300
How would I get the show all to work in the criteria?
Any help would be great!
Thanks
Russ
 
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?

--
More info, please ...

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
When the show all is selected show all dates, otherwise show the transaction -
the nuber of days selected. I just do not know how to get the show all to
work since it does not equal a number.
Hopefully this clears it up...
thanks

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]
Thanks
Russ
 
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]
Thanks
Russ
 
can anyone help?
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
[quoted text clipped - 10 lines]
 
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]
Thanks
Russ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top