default value or prompt for value in a report

  • Thread starter Thread starter Tina Marie
  • Start date Start date
T

Tina Marie

hello .. how do i have a report where when it runs a field will have a
default value in it but if i want to override it, i can with a prompt box or
something else??
 
You can assign a value to an unbound textbox in the load event of the
report, like:
me.mytxtbox = "Hello"
Then in the click event of the txtbox,
me.mytxtbox = "Goodbye"

Note that will only work in Report view of the report, not printview. You
have to directly print the report in report view. If you switch to
printpreview, your changes are lost.

Damon
 
Base the report on a query. In query design view enter something like the
following (as one line) in the 'field' row of a blank column:

MyValue: Nz([Enter a value if you wish to override the default, otherwise
leave blank],"My default value")

where 'My default value' is what you want to appear if the user does not
override it. Bind a text box control in the report to the MyValue column.
When the report is opened the user will be prompted to 'Enter a value if you
wish to override the default, otherwise leave blank'. If they leave it blank
and click OK the default value will show in the text box, if they enter a
value and click OK that value will appear.

Ken Sheridan
Stafford, England
 
Thanks Ken ... I'll give this a try ...
--
Thanks!!

T. Marie


Ken Sheridan said:
Base the report on a query. In query design view enter something like the
following (as one line) in the 'field' row of a blank column:

MyValue: Nz([Enter a value if you wish to override the default, otherwise
leave blank],"My default value")

where 'My default value' is what you want to appear if the user does not
override it. Bind a text box control in the report to the MyValue column.
When the report is opened the user will be prompted to 'Enter a value if you
wish to override the default, otherwise leave blank'. If they leave it blank
and click OK the default value will show in the text box, if they enter a
value and click OK that value will appear.

Ken Sheridan
Stafford, England
 
Hi Damon ... okay so this won't work if I print the report out? This report
will end up being an attachment for a person to sign ... like a contract ...
still working on that too ... access can use 'snapshot' but not everybody has
that ... if I send the report to word ... it looses the rectangle boxes I
have around fields ... so hope that convert to pdf will work ... now if your
suggestion will work in report view and then convert pdf then your way will
work too ... any suggestions on above? Thanks again Damon ...
--
Thanks!!

T. Marie


Damon Heron said:
You can assign a value to an unbound textbox in the load event of the
report, like:
me.mytxtbox = "Hello"
Then in the click event of the txtbox,
me.mytxtbox = "Goodbye"

Note that will only work in Report view of the report, not printview. You
have to directly print the report in report view. If you switch to
printpreview, your changes are lost.

Damon
 
Back
Top