Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Format Calculations

Status
Not open for further replies.

MeHere

Technical User
Mar 14, 2002
8
US
I am trying to do some extensive calc's during "on format". I am trying to open a query and perform the calcs on every other record. No problem with this until I try to set my array to a field in the current query record.

I get a runtime 2465. It's trying to find that field on the form instead of the query. Setfocus doesn't appear to help.
 
Are you familiar with recordsets/dynasets/etc.?
If so, that would let you easily qualify the item.

Even if not, I *think* you could dim and Set myObject to the query, and I recall the syntax to be something like myObject("MyField"). I'm just guessing - I don't recall if you can or not.

By "qualify" I mean prefix something to define what it refers to - a la, saying Form1.something.

I'm surprised that it let you get away with doing a query within the Report generation, since there is already a recordsource (e.g. query) in play for the report. Hope you pull it off.
 
You put this message in the 'reports' forum and you're talking about the 'on format' event so I'm going to assume that you're talking about a report.

If the field that is being looked for is in the recordsource of the report one quick and dirty way of taking care of it is to drop the field onto the report as an appropriate control (text, I would assume) and make it invisible. Reference that control instead of the field. Actually they can have the same name and you won't have to change your SQL string.
"The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
I had gathered that he was running another query during the event processing, sepArate from recordsource. A response from the original threader would help.
 
You're right larryww. I am running another query during event processing. My report summarizes some numerical data, but I need to do some calcs (the average of the averages of every 3 records, etc...) and pass this to the report summary.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top