|
|
| Next: brochure in landscape orientation printing out in.. |
| Author |
Message |
Bill External

Since: Jan 10, 2009 Posts: 12
|
Posted: Wed Oct 14, 2009 11:26 am Post subject: Detail Format event code Archived from groups: microsoft>public>access>reports (more info?) |
|
|
The Detail Format event code below pertains
to a report comprised of several pages for a
family directory. Each page has a capacity to
display 10 families, 5 in each of 2 columns.
The detail section contains one image control
and 10 text boxes, into which the public
function FmtDirAddr determines how and
what to populate into the unbound text boxes.
FmtDirAddr would necessarily include some
JET I/O to the back-end DB of its own, as
record information from tables other than the
primary RecordSource are accessed.
There's never been an issue with this code during
the past many years until we've advanced to faster
machines. With the faster machines, there are
sporadic instances where the image control
Me.ImageBox prints with only its boarder
displayed. My suspicion is that the I/O time
on the faster processors is such that the I/O does
not complete before the next record is processed
and the jpg image rendering in the control never
ends before processing proceeds to the next
record.
If my suspicion has some basis in fact, is there a
way to force VBA to wait until the I/O completes?
Otherwise, what other causes might there be?
Thanks,
Bill Stanton
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Dim ImagePath As String
'================================================================
' The FmtDirAddr sub is common to both the left and right side orientations.
We need only pass
' "our" report name to the sub so that the sub can reference "our" controls.
The various fields
' referenced in the calling sequence are "connected" to this report by means
of "invisible"
' controls you'd see if looking at the report in design mode.
'================================================================
ImagePath = IPImages & "\" & Me.FamilyImageID & ".jpg"
'Path to named image
If Len(Dir(ImagePath)) = 0 Then _
ImagePath = IPImages & "\DefaultPic.jpg" 'Use default if it doesn't
exist
Me.ImageBox.Picture = ImagePath
Call FmtDirAddr("PrtDirRight", [FamilyID], [FamilyName], [FamilyDirFmtID],
[FamilyPOBox], _
[FamilyAddress], [FamilyCityState], [FamilyZip],
[FamilyE-mail], [FamilyPhone])
End Sub |
|
| Back to top |
|
 |
Bill External

Since: Jan 10, 2009 Posts: 12
|
Posted: Thu Oct 15, 2009 9:53 pm Post subject: Re: Detail Format event code [Login to view extended thread Info.] Archived from groups: per prev. post (more info?) |
|
|
I thought it might be due to the jpg progress bar
being enabled, so I set that option to "No" in
the:
HKEY_LOCAL_MACHINE\Software\Microsoft\
Shared Tools\Graphics Filters\Import\JPEG\Options,
there is only one user on the offending machine,
so the key doesn't exist for
HKEY_CURRENT_USER.
Is there an API that I could use where I could
set a timer for the image control loading? Sort
of like I do with some applications using
ShellWait.
Bill
"Bill" <billstanton.DeleteThis@psln.com> wrote in message
news:e2$BivPTKHA.4000@TK2MSFTNGP05.phx.gbl...
> The Detail Format event code below pertains
> to a report comprised of several pages for a
> family directory. Each page has a capacity to
> display 10 families, 5 in each of 2 columns.
> The detail section contains one image control
> and 10 text boxes, into which the public
> function FmtDirAddr determines how and
> what to populate into the unbound text boxes.
> FmtDirAddr would necessarily include some
> JET I/O to the back-end DB of its own, as
> record information from tables other than the
> primary RecordSource are accessed.
>
> There's never been an issue with this code during
> the past many years until we've advanced to faster
> machines. With the faster machines, there are
> sporadic instances where the image control
> Me.ImageBox prints with only its boarder
> displayed. My suspicion is that the I/O time
> on the faster processors is such that the I/O does
> not complete before the next record is processed
> and the jpg image rendering in the control never
> ends before processing proceeds to the next
> record.
>
> If my suspicion has some basis in fact, is there a
> way to force VBA to wait until the I/O completes?
> Otherwise, what other causes might there be?
>
> Thanks,
> Bill Stanton
>
> Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
> Dim ImagePath As String
> '================================================================
> ' The FmtDirAddr sub is common to both the left and right side
> orientations. We need only pass
> ' "our" report name to the sub so that the sub can reference "our"
> controls. The various fields
> ' referenced in the calling sequence are "connected" to this report by
> means of "invisible"
> ' controls you'd see if looking at the report in design mode.
> '================================================================
>
> ImagePath = IPImages & "" & Me.FamilyImageID & ".jpg" 'Path to named
> image
>
> If Len(Dir(ImagePath)) = 0 Then _
> ImagePath = IPImages & "\DefaultPic.jpg" 'Use default if it doesn't
> exist
>
> Me.ImageBox.Picture = ImagePath
>
> Call FmtDirAddr("PrtDirRight", [FamilyID], [FamilyName], [FamilyDirFmtID],
> [FamilyPOBox], _
> [FamilyAddress], [FamilyCityState], [FamilyZip],
> [FamilyE-mail], [FamilyPhone])
> End Sub
> |
|
| Back to top |
|
 |
|
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|