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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show default query parameters on report 1

Status
Not open for further replies.

mikelev

Technical User
Mar 23, 2004
223
US
I have a report based on a query.

On the query I have the following:
Code:
Between Nz([Enter Start or press Enter for all Dates],#1/1/1900#) And Nz([Enter End or press Enter for all Dates],#12/31/3000#)

On the report I have an unbound textbox with the control =
Code:
="Reporting Dates from " & [Enter Start or press Enter for all Dates] & " to " & [Enter End or press Enter for all Dates]


Everthing works great when I put in values for the start and end dates. When I press enter (for all dates) the report shows nothing. I would like the report to show the defaults for the query. (i.e 1/1/1900 to 12/31/3000) or the text "All Dates" to "All Dates" would be prefered.


Many thanks in advance for any help!

Cheers
 
Hi.

try this: on the header of the report (sorry for my English - I'm Italian and use an Italian version of MSAccess 2000) create a text box, and on the "control origin" of the properties, write the criteria of your selection, e.g. ="Between " & [initial date] & " and " & [Final date].
If you have more than one criteria, use more text boxes, and all your selection will be printed along with the data of the report.
Let me know: if it wasn't clear i can send you some examples.

regards.

paolo camerano

 
Hi paolocamerano

I get the dates entered by the user just fine. What am looking for is some text to appear if the user simply presses enter (hitting enter at first prompt uses 1/1/1900 and enter at second prompt uses 12/31/3000).


Ultimatly I would like the text 'All Dates' rather than '1/1/1900' & '12/31/3000'

Cheers!
 
Start your solution from this expression:
=Reporting dates Between " & Nz([Enter Start or press Enter for all Dates],#1/1/1900#) & " And " & Nz([Enter End or press Enter for all Dates],#12/31/3000#)


Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Are you saying to put the code listed above as the control source for my unbound textbox? This gives me an invalid sytax error?

Thanks dhookum!
 
My bad, I missed a quote
="Reporting dates Between " & Nz([Enter Start or press Enter for all Dates],#1/1/1900#) & " And " & Nz([Enter End or press Enter for all Dates],#12/31/3000#)

Or
="Reporting dates Between " & Nz([Enter Start or press Enter for all Dates],"the beginning of time") & " And " & Nz([Enter End or press Enter for all Dates],"the end of time.")



Duane
MS Access MVP
[green]Ask a great question, get a great answer.[/green]
[red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
[blue]Ask me about my grandson, get a grand answer.[/blue]
 
Just what I needed. Once again you saved the bacon!

Thanks dhookum
Star for you!
 
I have created a MS Access 2003 Database with only one table called contacts with a formatted field "Birthdate" and the other is almost the same it called "Anniversary", once again it is also a formatted field. I've been trying to put it out to a report. The range of dates from either fields, The month and day are the only two values, the year value isn't relivent. Sorry, for the miss spellings if there are any.

I've tried: Between Nz([Enter Start date],#1/1/1900#) And Nz([Enter End],#12/31/3000#)

Between [Start date] And [End date]

Thank you
z92846 (paul)
 
formatted field" doesn't tell us anything about the value or datatype of the field. Can you tell us the datatype?

Apparently you have two date fields and want to be able to test the month and day of two entered dates against the month and day of the date fields?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top