fLoadPicture only for runtime version and problems printing

  • Thread starter Thread starter mdullni1 via AccessMonster.com
  • Start date Start date
M

mdullni1 via AccessMonster.com

System info: SQLServer backend, Access XP adp front end delivered to each PC
on boot.

I am using Leban's fLoadPicture code to counteract memory leak. The report
is a student directory that loads each student's jpg picture or a "No Image
Available" jpg, 6 students to a page. When a 143 page report was printed,
starting around page 117, random pictures did not load correctly. There are
blank images or the same image for multiple students.

In researching this problem, I found a couple of statements that said this
function is only for runtime version of Access. Should I not use this
function? When I Just set the picture property I got "out of memory"
messages.

Here is my code:


Const mstrNoImagePath As String = "\\Server\Photos\no_image.jpg"

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
'*****************************************************************************
'* Sub: Detail_Print
'* Purpose: Loads the student photo or "No Image Available" jpg.
'*****************************************************************************

Dim blnRVal As Boolean

'If PrintCount = 1 Then
If Nz(Me!txtPhotoPath, "") <> "" Then
blnRVal = fLoadPicture(Me!imgPhoto, Me!txtPhotoPath, False)
Else
blnRVal = fLoadPicture(Me!imgPhoto, mstrNoImagePath, False)
End If

'End If

End Sub

When first run the printcount statement was not commented out. I commented
it out to see if I still had the picture load problem, which I do.

Any help will be greatly appreciated. The directory has to go to print next
week.

Thanks,
Peg
 
The solution was developed for Runtime installs but can be used for full
installs as well(though it is not necessary).

Access is not the best host to render large reports containing Images. A
quick fix is to simply output half of your report at a time. For a longer
term fix, try removing my code and going back to the standard Image control.
Make sure you modify the Registry to turn off the Loading Image dialog and
keep your code in the section's Print event.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Thanks Stephen. Is it possible to change the registry from VBA each time
this report is run? I can't garantee that the registry setting on the user's
system will always stay off.

Peg

Stephen said:
The solution was developed for Runtime installs but can be used for full
installs as well(though it is not necessary).

Access is not the best host to render large reports containing Images. A
quick fix is to simply output half of your report at a time. For a longer
term fix, try removing my code and going back to the standard Image control.
Make sure you modify the Registry to turn off the Loading Image dialog and
keep your code in the section's Print event.
System info: SQLServer backend, Access XP adp front end delivered to each
PC
[quoted text clipped - 47 lines]
Thanks,
Peg
 
Sure you could change them. I have not tested though whether Access would
recognize the changes during the current open session.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.


mdullni1 via AccessMonster.com said:
Thanks Stephen. Is it possible to change the registry from VBA each time
this report is run? I can't garantee that the registry setting on the
user's
system will always stay off.

Peg

Stephen said:
The solution was developed for Runtime installs but can be used for full
installs as well(though it is not necessary).

Access is not the best host to render large reports containing Images. A
quick fix is to simply output half of your report at a time. For a longer
term fix, try removing my code and going back to the standard Image
control.
Make sure you modify the Registry to turn off the Loading Image dialog and
keep your code in the section's Print event.
System info: SQLServer backend, Access XP adp front end delivered to
each
PC
[quoted text clipped - 47 lines]
Thanks,
Peg
 
Back
Top