Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question Regarding User Imput

Status
Not open for further replies.

HerickP

IS-IT--Management
May 10, 2000
68
US
Hi,<br><br>Thanks to this forum, I have got my Project almost done, except that I still got some little probs to overcome:<br><br>I learned how to sort a field by date range ( like from 05/01/00 to 05/10/00), but this way, I need to have predefined dates, so I would like to have the user to imput these dates instead, like having a form with 2 textboxes where the user would imput a date on each one of them, click a button and have the query or search returned.....How to do this?? Somebody gave me some code, but I dunno where or how to apply....Please help
 
create an unbound form (dateform) with the two date boxes (ie, startdate, enddate).<br>create a query with the data that you want.<br>in the criteria of the date field you want to limit place the conditions<b><br>&gt;[Forms]![Dateform]![startdate] AND &lt;[Forms]![dateform]![enddate]</b><br><br>or alternately, you could just put <br>&gt;[startdate] AND &lt;[enddate] in the same criteria, and Access would prompt the user for both of the dates anyway.&nbsp;&nbsp;the only difference being that with the form you can use an input mask to put the slashes in for the user so he/she does not have to type them. <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
<br>There a a couple of ways dependent on how long you want to keep the new criterion availible.<br><br>The query you'll use ends up looking something like:<br><br>&quot;SELECT * FROM table1 WHERE start &gt;=#&quot; & [startdate] &&quot;# and<br>&quot;end is &lt;= #&quot;& [enddate] & &quot;#&quot;. You may want to check first to&nbsp;&nbsp;make sure the dates are in an acceptable range before doing anything. <br><br>The calendar control works pretty good or you can roll your own utilizing offsets from the current date; using the 'DateAdd()' function and a couple of buttons. <br><br>Well, that about does it. Good Luck.<br><br><br><br><br><br> <p>Amiel<br><a href=mailto:amielzz@netscape.net>amielzz@netscape.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top