Tip on renamed field names and debugging reports
Today's Guest Writer: Tony Toews, Microsoft Access MVP
I have a complex report with 5 grouping levels, subtotals, and three subreports for additional details of totals. There are also lots of calculated fields on the report with embedded control names.
I had to rename some fields in the base query as I had to insert some IIF logic in the query.
Well, I couldn't figure out where one particular field was being used. I looked in the usual suspect places by examining the object list. I then looked at the Sorting and Grouping sheet because that has caused me troubles in the past. Not there either.
Access 2003 usually has these nice widgets, or tips, or whatever those little black/navy triangular doodads in the corner of a control when you find a problem. (This feature BTW is the single nicest feature of A2003. IMNSHO and is well worth upgrading from previous versions for the developer or power user.) But these didn't work this time.
So I used the SaveAsText--at the debug/immediate window type: Application.SaveAsText acReport, "MyReport", "c:\report.txt"
I opened the text field and found that that field in the Link Child Fields of a subreport. Whoohoo. Fixed.
Clint here--You can find other useful content from Tony on his web site. If you have a tip that you would like to pass along on this blog, send it my way. I'm always looking for good content to keep you all interested :-).
E4-27 Edited code to export report not form.
Comments
Anonymous
April 27, 2007
Since you're having a problem with a report, why do you store a form in text format?Anonymous
April 28, 2007
I modified the code to export a report not form. This technique isn't about storing it as text but asking Access to write out the text representation. You can then use notepad to search for the field that is causing problems.Anonymous
April 28, 2007
When you look at the text representation in Notepad, what gives away the field that's causing problems? What exactly do you mean by, "I open the text field"?Anonymous
April 28, 2007
You search for the name of the field that is being prompted in the report. Once you find it it is pretty easy to see what property the old name is associated with.Anonymous
April 28, 2007
Thanks Clint, I suppose you meant to say, "I opened the text file".Anonymous
May 08, 2007
I posted a tip to the MVP private discussion group and Clint Covington of MS liked it enough he, with