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
|
|||
|
|||
Query by month
I have a query which returns all information from two tables.
I would to build a search form which askes for beginning and closing date. After adding the dates, I would like a query (or report) to open in a subform and reflect the rows from the query only between those dates. I know how to build the form and subform, just not complete the search and results. Where do I start? Thank You. |
#2
|
|||
|
|||
Query by month
In the Criteria row of the query, under your data field, enter something
like this (as one line): = [Forms].[Form1].[txtStartDate] And [Forms].[Form1].[txtEndDate] + 1 Substitute your search form's name for Form1, and your textbox names for txtStartDate and txtEndDate. If these controls are unbound, declare the parameters in the query to ensure Access understands the data type. In query design view, choose Parameters from the menu/ribbon. Access opens a dialog, where you enter 2 rows like this: [Forms].[Form1].[txtStartDate] Date/Time [Forms].[Form1].[txtEndDate] Date/Time For more details, and another possible approach, see: Limiting a Report to a Date Range at: http://allenbrowne.com/casu-08.html -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Humbled Learner" wrote in message ... I have a query which returns all information from two tables. I would to build a search form which askes for beginning and closing date. After adding the dates, I would like a query (or report) to open in a subform and reflect the rows from the query only between those dates. I know how to build the form and subform, just not complete the search and results. Where do I start? Thank You. |
#3
|
|||
|
|||
Query by month
If you already have controls on your form for the two dates, enter this in
the 'Criteria' for the date field in your query: Between [Forms]![myForm]![startdate] And [Forms]![myForm]![closingdate] replace 'myForm' with the name of your form for entering dates, replace 'startdate' and 'closing date' with the names of the controls on the form. To display the results in the subform, set its Record Source to that query. hth "Humbled Learner" wrote: I have a query which returns all information from two tables. I would to build a search form which askes for beginning and closing date. After adding the dates, I would like a query (or report) to open in a subform and reflect the rows from the query only between those dates. I know how to build the form and subform, just not complete the search and results. Where do I start? Thank You. |
Thread Tools | |
Display Modes | |
|
|