Fill the blank fields while preview/print

G

Guest

This is in reference to a question and answer posted earlier this week
regarding filling the blank fields. The advisor advised that it is possible
to fill the blank fields in report.

I have a report based on a table. Generally many of the fields are blank.
I want to fill these blank fields as below to preview better looks of report.

If the control DataType is Text and IsNull then "No Info"
If the control DataType is Number And IsNull Then 0
If the control DataType is Date and IsNull Then Date()

These information I dont want to save in the table as data. Only for better
looks , I want to fill the blank fields as above.

Requesting professionals to advise.

Regards
Irshad
 
M

Marshall Barton

Irshad said:
This is in reference to a question and answer posted earlier this week
regarding filling the blank fields. The advisor advised that it is possible
to fill the blank fields in report.

I have a report based on a table. Generally many of the fields are blank.
I want to fill these blank fields as below to preview better looks of report.

If the control DataType is Text and IsNull then "No Info"
If the control DataType is Number And IsNull Then 0
If the control DataType is Date and IsNull Then Date()

These information I dont want to save in the table as data. Only for better
looks , I want to fill the blank fields as above.


I'm a little confused by your use of "control DataType".
Controls don't really have a data type (well they're treated
as Variants, which doesn't help much).

I suspect that you are referring to the data type of the
record source **field** that the control is bound to? If
that's the case (i.e. you know, at design time, the data
type of the control's value), then you can use an expression
in the text box control source property:

=Nz(textfield, "No Info")
=Nz(numberfield, 0)
=Nz(datefield, Date())
 
G

Guest

Sorry for my late reply.

Your guess is correct. By DataTypes I tried to indicate the Field Datatype
and is bound to a table.

The thing is that the report is already designed.

Is it possible to run a Vb code to carry out the same work on report Format
property. I mean I want to write a code to report format property.

Please advise is it possible. if yes, how to write.

regards.

Irshad
 
M

Marshall Barton

What I was trying to say before is that I don't see a need
for any VBA code. You can just open the report in design
view and change the problem text box's ControlSource
property to something like the expressions I posted. If
these concepts are new to you, please post back with a
specific question about the part you are having trouble
with.

An alternative approach to your problem is to modify the
report's record source query to use the same expressions I
posted as calculated query fields. I would need to see your
current query to provide a more detailed suggestion.

If I've missed the point of your question, please expand on
your statement about "the report is already designed". As
far as I can tell, that doesn't really matter (or it makes
the problem extremely difficult).
 

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