A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Passing data from a form to a query



 
 
Thread Tools Display Modes
  #1  
Old August 19th, 2004, 08:48 PM
JoD
external usenet poster
 
Posts: n/a
Default Passing data from a form to a query

I am an infrequest user of Microsoft Access. I am trying
to use a form to select a Quarter (1, 2, 3, 4). If the
quarter = 1, I need to pass the query Months 1 or 2 or 3.
When I type 1 or 2 or 3 directly into the criteria of the
query, I get the correct results. When I pass 1 or 2 or 3
from the form, I get nothing. Any ideas?
  #2  
Old August 20th, 2004, 01:24 AM
Ken Snell [MVP]
external usenet poster
 
Posts: n/a
Default

Because the form is receiving a single number, why not put a calculated
field in your query that matches the form's information? Put a calculated
field in the query that calculates the quarter number from the DateFieldName
field:

QtrValue: ((Month([DateFieldName]) - 1) \ 3) + 1

Then put this expression in the "Criteria:" box for this field:

[Forms]![FormName]![ControlNameOnForm]

--

Ken Snell
MS ACCESS MVP

"JoD" wrote in message
...
I am an infrequest user of Microsoft Access. I am trying
to use a form to select a Quarter (1, 2, 3, 4). If the
quarter = 1, I need to pass the query Months 1 or 2 or 3.
When I type 1 or 2 or 3 directly into the criteria of the
query, I get the correct results. When I pass 1 or 2 or 3
from the form, I get nothing. Any ideas?



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Query to join records form 2 databases bdehning General Discussion 5 August 9th, 2004 03:09 PM
Struggling with MS Query... Alex General Discussion 5 July 6th, 2004 11:46 AM
Form not retrieving same data as query JMorrell General Discussion 3 June 15th, 2004 02:04 AM
surely a form with a ListBox can be used in a query? 1.156 Running & Setting Up Queries 14 June 2nd, 2004 04:54 PM
Form Doesn't Go To New Record Steve New Users 15 May 16th, 2004 04:33 PM


All times are GMT +1. The time now is 12:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.