If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Searching for records between two dates
Ok, I have two text boxes two enter short dates into, a button click opens a
form which displays the results of a query that does the date comparison. When I click the button access then asks me to put the dates in, even though they're already in the textboxes. If I enter the dates into the prompts then the results are correct. What I'm, wondering is why the query can't seem to read the values from the form directly. Is there something extra that needs to be done with dates? |
#2
|
|||
|
|||
What have you got in the query as parameters? If it's Forms!name of
form!name of control (where name of form and name of control are replaced with the appropriate values), it should work. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Nick in Tokyo" wrote in message ... Ok, I have two text boxes two enter short dates into, a button click opens a form which displays the results of a query that does the date comparison. When I click the button access then asks me to put the dates in, even though they're already in the textboxes. If I enter the dates into the prompts then the results are correct. What I'm, wondering is why the query can't seem to read the values from the form directly. Is there something extra that needs to be done with dates? |
#3
|
|||
|
|||
it's
=[Forms]![License_Search_Menu]![DateFrom] And =[Forms]![License_Search_Menu]![DateTo] "Douglas J. Steele" wrote: What have you got in the query as parameters? If it's Forms!name of form!name of control (where name of form and name of control are replaced with the appropriate values), it should work. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Nick in Tokyo" wrote in message ... Ok, I have two text boxes two enter short dates into, a button click opens a form which displays the results of a query that does the date comparison. When I click the button access then asks me to put the dates in, even though they're already in the textboxes. If I enter the dates into the prompts then the results are correct. What I'm, wondering is why the query can't seem to read the values from the form directly. Is there something extra that needs to be done with dates? |
#4
|
|||
|
|||
Actually, it's kind of working now. Without my changing it. Now, if I don't
enter anything into the prompts, it brings up the correct results. But it's still prompting me. Can I get rid of the prompts? "Douglas J. Steele" wrote: What have you got in the query as parameters? If it's Forms!name of form!name of control (where name of form and name of control are replaced with the appropriate values), it should work. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Nick in Tokyo" wrote in message ... Ok, I have two text boxes two enter short dates into, a button click opens a form which displays the results of a query that does the date comparison. When I click the button access then asks me to put the dates in, even though they're already in the textboxes. If I enter the dates into the prompts then the results are correct. What I'm, wondering is why the query can't seem to read the values from the form directly. Is there something extra that needs to be done with dates? |
#5
|
|||
|
|||
Is it possible that you've got a typo somewhere in the form?
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Nick in Tokyo" wrote in message ... Actually, it's kind of working now. Without my changing it. Now, if I don't enter anything into the prompts, it brings up the correct results. But it's still prompting me. Can I get rid of the prompts? "Douglas J. Steele" wrote: What have you got in the query as parameters? If it's Forms!name of form!name of control (where name of form and name of control are replaced with the appropriate values), it should work. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Nick in Tokyo" wrote in message ... Ok, I have two text boxes two enter short dates into, a button click opens a form which displays the results of a query that does the date comparison. When I click the button access then asks me to put the dates in, even though they're already in the textboxes. If I enter the dates into the prompts then the results are correct. What I'm, wondering is why the query can't seem to read the values from the form directly. Is there something extra that needs to be done with dates? |
#6
|
|||
|
|||
On Wed, 18 Aug 2004 18:37:02 -0700, "Nick in Tokyo"
wrote: Actually, it's kind of working now. Without my changing it. Now, if I don't enter anything into the prompts, it brings up the correct results. But it's still prompting me. Can I get rid of the prompts? A couple of possibilities: - Is the form open when you try to run the query? It should be; the query won't open the form for you. - Might you have misspelled the name of the form in the criterion? - It may be worthwhile to put the two parameters into the Query's Parameters collection: right mouseclick the grey background of the tables in the query grid, select Parameters, and copy and paste the criteria (they must match EXACTLY) into the Parameters column. Specify Date/Time in the second column. John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
#7
|
|||
|
|||
Thankyou, I had a typo in my parameter specs. Fixed now. Thanks very much for
your help. Now if you could tell me how to get a cancel button going (above) then I'll love you forever. "John Vinson" wrote: On Wed, 18 Aug 2004 18:37:02 -0700, "Nick in Tokyo" wrote: Actually, it's kind of working now. Without my changing it. Now, if I don't enter anything into the prompts, it brings up the correct results. But it's still prompting me. Can I get rid of the prompts? A couple of possibilities: - Is the form open when you try to run the query? It should be; the query won't open the form for you. - Might you have misspelled the name of the form in the criterion? - It may be worthwhile to put the two parameters into the Query's Parameters collection: right mouseclick the grey background of the tables in the query grid, select Parameters, and copy and paste the criteria (they must match EXACTLY) into the Parameters column. Specify Date/Time in the second column. John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
#8
|
|||
|
|||
On Thu, 19 Aug 2004 01:01:01 -0700, "Nick in Tokyo"
wrote: Thankyou, I had a typo in my parameter specs. Fixed now. Thanks very much for your help. Now if you could tell me how to get a cancel button going (above) then I'll love you forever. I'm not altogether certain that your offered incentive is the best choice but... a Cancel button with code such as Private Sub cmdCancel_Click() Dim iAns As Integer iAns = MsgBox("This will cancel the entry and erase your input. OK?" _ , vbYesNo) If iAns = vbYes Then Me.Undo End If End Sub will let the user cancel a record being added (of course, hitting Esc twice will do the same). Since I couldn't find a post in this thread involving a cancel button, I'm not sure this is what you want! John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Chart possible of dates vs. pounds? | GBL | General Discussion | 3 | July 6th, 2004 03:56 AM |
CountIf function + dates | patricia | Worksheet Functions | 3 | May 24th, 2004 11:27 PM |
Sumproduct search between Dates | Robert Christie | Worksheet Functions | 5 | May 22nd, 2004 03:09 PM |
Charting woes with hidden dates | dustin pockets | Charts and Charting | 4 | April 15th, 2004 04:20 AM |
subtracting dates to give a whole number | Lasitter | Worksheet Functions | 2 | October 1st, 2003 09:14 AM |