Correct syntax for referencing a form control????

W

Weeble

I have a report that has calculated some totals for me and I want to put
these totals into another calculation instead of re-writing the whole thing
again.

I keep getting a message telling me the report doesn't exist or that the
name is typed incorrectly. I can only conclude my syntax is incorrect.

This is what I used:

CorrectionsTtl = Reports![ProductionInfoAttendance]![CorrectionsTotal]

I have confirmed the spelling on my report and my field.
 
D

Dirk Goldgar

Weeble said:
I have a report that has calculated some totals for me and I want to put
these totals into another calculation instead of re-writing the whole
thing
again.

I keep getting a message telling me the report doesn't exist or that the
name is typed incorrectly. I can only conclude my syntax is incorrect.

This is what I used:

CorrectionsTtl = Reports![ProductionInfoAttendance]![CorrectionsTotal]

I have confirmed the spelling on my report and my field.


Your message subject says "form control", but you're talking about a control
on a report, right?

Your syntax appears to be correct, but will only work if the report is open
(presumably in Print Preview) at the time you execute the statement. If it
isn't, you should expect to get the message, "The report name
'ProductionInfoAttendance' you entered is misspelled or refers to a report
that isn't open or doesn't exist." If that's the message you're guessing,
then I guess the report isn't open when you execute the code.
 
W

Weeble

Dirk,

Thanks. That took care of it. I feel a bit stupid about now.

Dirk Goldgar said:
Weeble said:
I have a report that has calculated some totals for me and I want to put
these totals into another calculation instead of re-writing the whole
thing
again.

I keep getting a message telling me the report doesn't exist or that the
name is typed incorrectly. I can only conclude my syntax is incorrect.

This is what I used:

CorrectionsTtl = Reports![ProductionInfoAttendance]![CorrectionsTotal]

I have confirmed the spelling on my report and my field.


Your message subject says "form control", but you're talking about a control
on a report, right?

Your syntax appears to be correct, but will only work if the report is open
(presumably in Print Preview) at the time you execute the statement. If it
isn't, you should expect to get the message, "The report name
'ProductionInfoAttendance' you entered is misspelled or refers to a report
that isn't open or doesn't exist." If that's the message you're guessing,
then I guess the report isn't open when you execute the code.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 

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