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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report preview OK but #name when print

Status
Not open for further replies.

moonbase

Programmer
Nov 18, 2002
57
GB
All reports in my application are OK in my development environment (Access XP, Windows XP). However when running on the end user's PC (Access runtime, Windows 98) some reports are OK when previewed but some fields print #name when printed.

I have no control over this within VBA so what's going on?
 
How is your app networked? Have you got a front-end on every PC and if so, are all the requisite fields present in the queries, or with the correct names. '#Name' means that the field referred to by the control on the report is missing or mis-referenced.

Have fun! :eek:)

Alex Middleton
 
Everything is set up correctly with a front and back end. It is a test environment and copied from a working XP environment.

The statement is
DoCmd.OpenReport "rptStatement", acViewPreview

The strange thing is - the display on screen is correct, it's wrong on the print (file menu, print). So presumably theres no coding or set up error. I guess it could be a timing issue. It generates the report again when printing and it may be the printing takes longer.

 
Are you closing a form at any point in your code? I have seen this happen when a needed form is closed in the On Close event of a report or sooner.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks, that's a good thought (you must be bordering on genius). The form is closed after the openreport statement and the report does use data from the form.

I can't get it to go wrong on my XP PC but have now changed the report so it uses global functions. I'll try on the 98 PC later this week.

 
Don't close the form. You can set its visible property to false if you don't want to see it.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Unfortunately this didn't work.

Viewing the report is correct. When printed (by selecting file, print) some fields print as #name. The problem fields involve functions and concatenations of strings. The simple fields are OK.

This is only a problem running with the runtime on Windows 98. I am getting various other problems on 98 the main one being the speed and I will start a new thread for this.

 
Do any of the "some fields print as #name" have anything to do with values from your form? Have you checked the references? Doug Steele has information on references at
Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I have checked again and everything looks correct. It's only on Windows 98 (XP is OK) and it's only printing from the print preview screen. What I haven't tried is printing without preview - that's next.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top