Default Value in Report??

J

JNana

I need to have default values in a report. I have the default value in my
tables. I created a query from which the report is based. The default
value does not appear in the query and it does not appear in the report.
Can you please advise how to accomplish this? I do not see the option to
select default value on the field properties in the report either.

I am also emailing this report by analyzing with excel first. The
background color does not carry over to excel. Can this be done?

Thanks in advance for your help.
 
A

Allen Browne

The Default Value is the value Access assigns to the field when you enter a
new record. It has no impact on existing records. That is, the value is NOT
used for records where you leave the field blank.

If you do wish to supply a value for the nulls, you could create a query
that would do that. For example, if you have a field named Country, and you
want the report to show USA if the Country field is blank, you could type
this into a fresh column in the Field row of your query:
CountryName: Nz([Country], "USA")
If the field was numeric, and you wanted a zero instead of a blank, you
would use:
AmountToShow: Nz([Amount],0)
You can then use these fields on the report, and the value of the 2nd
argument in Nz() will be shown where the field is null.

Graphical elements are lost from the report when exported to Excel or Word.
You could export a snapshot. The recipient would need the snapshot viewer
(free down load from Microsoft.)
 
J

JNana

Thank you
Allen Browne said:
The Default Value is the value Access assigns to the field when you enter a
new record. It has no impact on existing records. That is, the value is NOT
used for records where you leave the field blank.

If you do wish to supply a value for the nulls, you could create a query
that would do that. For example, if you have a field named Country, and you
want the report to show USA if the Country field is blank, you could type
this into a fresh column in the Field row of your query:
CountryName: Nz([Country], "USA")
If the field was numeric, and you wanted a zero instead of a blank, you
would use:
AmountToShow: Nz([Amount],0)
You can then use these fields on the report, and the value of the 2nd
argument in Nz() will be shown where the field is null.

Graphical elements are lost from the report when exported to Excel or Word.
You could export a snapshot. The recipient would need the snapshot viewer
(free down load from Microsoft.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

JNana said:
I need to have default values in a report. I have the default value in my
tables. I created a query from which the report is based. The default
value does not appear in the query and it does not appear in the report.
Can you please advise how to accomplish this? I do not see the option to
select default value on the field properties in the report either.

I am also emailing this report by analyzing with excel first. The
background color does not carry over to excel. Can this be done?

Thanks in advance for your help.
 
M

Marshall Barton

JNana said:
I need to have default values in a report. I have the default value in my
tables. I created a query from which the report is based. The default
value does not appear in the query and it does not appear in the report.
Can you please advise how to accomplish this? I do not see the option to
select default value on the field properties in the report either.

I am also emailing this report by analyzing with excel first. The
background color does not carry over to excel. Can this be done?


The DefaultValue property, regardless of where you specify
it, only applies to fields that are unspecified when a **new
record** is saved.

Generally, a Null value in a field indicates that nothing
was entered in the field when the record was created. If
that's what you have, then use an expression in the report
text boxes =Nz(fieldname, valuetodisplaywhennull) and make
sure the control is named something other than fieldname.

When you "publish" a report, it's essentially only the data
that is being sent. Most eye candy such as colors, lines,
etc. are not translatable to another program so, No, it can
not be done.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top