Thread: parameters
View Single Post
  #7  
Old January 15th, 2010, 10:34 PM posted to microsoft.public.access.tablesdbdesign
Duane Hookom[_4_]
external usenet poster
 
Posts: 316
Default parameters

All user interaction should be managed through forms. IMO, don't allow users
to ever see your database window or tables.

Assuming you have a report to open filtered based on start and end dates,
you can add a couple text boxes on a form for the user to enter (or select
using a calendar control). Name the text boxes txtStart and txtEnd. You can
then add references to these controls in your report's record source query.
The criteria under your date field might look something like:
Between Forms![YourFormNameHere]!txtStart And
Forms![YourFormNameHere]!txtEnd

I prefer using the Where Condition of the DoCmd.OpenReport method.

To display the values of the text boxes, add a text box on your report with
a control source like:
="Between " & Forms![YourFormNameHere]!txtStart & " And " &
Forms![YourFormNameHere]!txtEnd

Duane Hookom
MS Access MVP

"JoAnn" wrote in message
news
Thanks - I am interested in using a form instead of parameters, but I'm
not
sure how to do that. Can you expand on that? (thanks)
--
JoAnn


"Duane Hookom" wrote:

IMO, your users should never be hit with parameter prompts. Consider
using
controls on forms for all user interaction. You can then reference the
controls in text boxes on your report:
Control Source: =Forms!frmRptCrit!txtFromDate

Duane Hookom
MS Access MVP

"JoAnn" wrote in message
...
Hi,

how can I get the parameters to print on a report so the reader knows
what
dates that information covers without having to enter the dates twice?

Thanks!
--
JoAnn