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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |