Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Not always printing data on a report

Not always printing data on a report

Not always printing data on a report

I have a series of forms that after a user has entered some data, on submit also prints out a report, there are times when the report doesn't always print out the data (text fields and bar chart) it just comes out blank.

I am using this in my vba code

DoCmd.OpenReport "Agent_Report_Nodd_Com", acPreViewReport, , "Report_Mon_ID = " & Me.ID.Value

The Me.id is a form identity field that is picked up, the report then queries the backend SQL database to get the data. This is consistent, in that it does pull it back except for a few users.

If I add a pause will this solve the issue?? or do I need to do something else to make this work everytime?

'Clever boy...'

RE: Not always printing data on a report

If this is a new record, it might not be saved/committed to the database. Try add a line of code to save the record prior to opening the report.

CODE --> vba

' save the current record
    If Me.Dirty Then
        Me.Dirty = False
    End If
    DoCmd.OpenReport "Agent_Report_Nodd_Com", acPreViewReport, , "Report_Mon_ID = " & Me.ID.Value 

Hook'D on Access
MS Access MVP

RE: Not always printing data on a report


Thanks for that, however, the record is beuing updated by the user not a brand new one created, sorry, that wasn't very clear of me.

I have looked at the update command, and made sure that it is happening before the open report, and it is.

'Clever boy...'

RE: Not always printing data on a report

So you are suggesting the same code to open the report works for some and doesn't display any data from the record source for other users?

I'm not sure I have heard of this. Is the record source somewhat complex?

Hook'D on Access
MS Access MVP

RE: Not always printing data on a report

Not overly, the call to the report pulls in the id, the report itself reads data from a table where the data is pushed to once submit is pressed on the form, by way of a stored procedure, which again uses the ID.

It does seem strange that it is only some users, I can't ever replicate it and because it's an auto process, by the time it's printed out the table has been cleared.

TBH I was just trying to negate any obvious system errors before i throw it back at IT and get them to check network/printer settings again.

'Clever boy...'

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close