Fields

P

Peter Kinsman

In the Detail_Print section of one report, I have been able to refer to the
fields from the underlying query. In another, although me. shows the
fields, if I try to use them, I get a run time error 2465 : Microsoft Office
Access can't find the field 'Unit@ referred to in your expression. Can
anyone help please?

Many thanks

Peter Kinsman
 
P

Peter Kinsman

Me.txtQty = Iif([Unit] = "Ea", Format([MeatQty], "0"), Format([MeatQty],
"0.00")) & [Unit]

Unit and MeatQty are fields in the query that is the Record Source for the
report.
 
T

TC

Do each of those fields actually have a control (say a textbox) on the
report?

If I remember correctly, in a report, you can only refer to fields that
are in the recordsource of the report /and/ actually have a control on
the report. This is unlike forms, where you can refer to any field in
the recordsource of the form, regardless of whether the field does or
does not actually have a control on the form.

If this is the problem, but you do not want those fields to show
directly on the report, just add a textbox for each of them, but set
the textbox Visible properties to False, so they do not display.

HTH,
TC [MVP Access]
 
P

Peter Kinsman

They are just fields from the query, but the same is true of the report
which does work.

Peter
 
T

TC

You said the report /doesn't/ work.

If it /does/ work, what is the problem?

TC [MVP Access]
 
P

Peter Kinsman

Solved it - I think

In the Detail_Format section of the report that does work I have the line
If VATMk = "*" Then Me.txtVATMsg.Visible = True
Now VATMk is not a control, but it is used as the Control Source for a
textbox, so presumably that is why it is available.

Regards

Peter
 

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