Report support! (1 Viewer)

BradTN

New member
Local time
Today, 13:10
Joined
Mar 23, 2019
Messages
4
Hey Guys I am really hoping you can help me cause I am about to lose my mind. I have a report I have generated in access with a 600dpi legal letter size embedded image. The idea is I have a form my users fill out, they click a button which then saves and prints the data on said form. For awhile Seemed everything was great my form printed everything lined up perfectly but then very randomly when printing even with proper print preview showing my embedded image would not print just the data but no image. There seems to be no rhyme or reason for this behaviour. Even if I do a print to pdf the same thing will randomly happen it will generate the pdf with just data no image. Also at times the print preview will also not display the image and only the data. I cant pinpoint what the issue is or why it comes and goes. I did find some similar posts about this issue from many years back seemingly pointing to this being a msaccess bug but also from those searches supposedly Microsoft fixed it. I can reproduce the issue on many different printers and computers with a very high failure rate. I am not sure how to resolve this as this aspect of my database is very important and will be used a lot. If there is anything I can do to help make this clearer please let me know thank you for your time.
 

JHB

Have been here a while
Local time
Today, 19:10
Joined
Jun 17, 2012
Messages
7,723
It could be a time issue, could you show the whole code you use for printing out.
 

BradTN

New member
Local time
Today, 13:10
Joined
Mar 23, 2019
Messages
4
Ok I will do that, but the same issue occurs even without my print button and simply flipping back and forth via design view/print view/layout etc..


Code:
On Error Resume Next
DoCmd.RunCommand acCmdSaveRecord  ' save the data before printing
If Err.Number = 3021 Then
  On Error GoTo 0 ' resume error trapping
  Exit Sub
Else
  If Err.Number <> 0 Then ' report problem
    MsgBox "Error Number: " & Err.Number & vbCrLf & Err.DESCRIPTION
    On Error GoTo 0 ' resume error trapping
    Exit Sub
  Else ' print, maybe
    On Error GoTo 0 ' resume error trapping
    If Len(Me.[CONTROL_NUM] & vbNullString) > 0 Then ' print
    ' print three copies
      DoCmd.OpenReport ("rpt241"), acViewNormal, , temp ' open/print report
      DoCmd.OpenReport ("rpt241"), acViewNormal, , temp ' open/print report
      DoCmd.OpenReport ("rpt241"), acViewNormal, , temp ' open/print report
    
      Call MessageBoxTimer("Print Job Transmitted") ' short popup
      DoCmd.Close acReport, "rpt241", acSaveNo
    Else ' user hit esc, or something cleared the control number, just close form to bail out
      DoCmd.Close acForm, "frm241", acSaveNo
    End If
  End If
End If
End Sub
 

JHB

Have been here a while
Local time
Today, 19:10
Joined
Jun 17, 2012
Messages
7,723
May I ask, why do you've all that error handling?
And one of the worst you've is "On Error Resume Next" so you'll even not recognize when an error occur!
 

BradTN

New member
Local time
Today, 13:10
Joined
Mar 23, 2019
Messages
4
May I ask, why do you've all that error handling?
And one of the worst you've is "On Error Resume Next" so you'll even not recognize when an error occur!

I believe this is from the trial and error phase of trying to get the print function going and as you have very clearly noticed I am quite new to access and all of this in general... sorry! What can you suggest I change this to in regards to this very weird issue. Regardless of print code the same odd behaviour occurs within the report screens itself..
 

JHB

Have been here a while
Local time
Today, 19:10
Joined
Jun 17, 2012
Messages
7,723
Is it a form or a report you print out?
Is your database split in a Front-/Backend database?
Where is the picture located?
Could you post your database with some sample data, zip it because you haven't post 10 post yet!
 

BradTN

New member
Local time
Today, 13:10
Joined
Mar 23, 2019
Messages
4
the data is filled in form and over-layed and from clicking the button entry is saved / sent to the report where I have the fields laid out onto the report I made. The image is embedded not linked in the report. Unfortunately this is not something I can really publicly post. Would you mind maybe PM'ing me ? Maybe you can take a peak via TeamViewer? My database is currently not split yet between front and backend but it is going to be very soon. I cant really cut out this part of my database either as lot of other moving parts involved. Your patience is appreciated.
 

JHB

Have been here a while
Local time
Today, 19:10
Joined
Jun 17, 2012
Messages
7,723
I haven't TeamViewer.
How big is you picture in MB?
I would suggest you to create a new button where you only open the report, and NO error handling. Only open the report.
If that still gives problem make a copy of the report, delete the image container.
Create a new image container with another picture in it, (a small one).
The try also a "Compact & Repair".
 

Users who are viewing this thread

Top Bottom