M
mallarym
I have a report that is two pages long for each record. I have a function
that I am calling to change images to a filepath. The problem is that when
you open the report, it moves to the next record when you move to the second
page. HELP!!! I am calling it from a groupheader_onFormat. Here is my code.
Public Function SetImages()
Dim SoldierID As Integer
SoldierID = Reports!DD1833all.RecordID.Value
' CHANGE FINGERPRINT
Change_print:
Dim rstSoldier As Recordset
Set rstSoldier = CurrentDb.OpenRecordset("select
[Deployable].prints,[Deployable].frontpic,
[Deployable].sidepic,[Deployable].wholename from [Deployable] Where ID = " &
SoldierID)
Dim Printpath As String
Printpath = rstSoldier!prints
Dim printResult As Boolean
printResult = Len(Dir(Printpath)) > 0
If printResult = False Then
Reports!DD1833all.PrintPic.Visible = False
Reports!DD1833all.PrintError.Visible = True
Else
Reports!DD1833all.PrintPic.Picture = Printpath
End If
GoTo exit_this
Exit_this:
End Function
that I am calling to change images to a filepath. The problem is that when
you open the report, it moves to the next record when you move to the second
page. HELP!!! I am calling it from a groupheader_onFormat. Here is my code.
Public Function SetImages()
Dim SoldierID As Integer
SoldierID = Reports!DD1833all.RecordID.Value
' CHANGE FINGERPRINT
Change_print:
Dim rstSoldier As Recordset
Set rstSoldier = CurrentDb.OpenRecordset("select
[Deployable].prints,[Deployable].frontpic,
[Deployable].sidepic,[Deployable].wholename from [Deployable] Where ID = " &
SoldierID)
Dim Printpath As String
Printpath = rstSoldier!prints
Dim printResult As Boolean
printResult = Len(Dir(Printpath)) > 0
If printResult = False Then
Reports!DD1833all.PrintPic.Visible = False
Reports!DD1833all.PrintError.Visible = True
Else
Reports!DD1833all.PrintPic.Picture = Printpath
End If
GoTo exit_this
Exit_this:
End Function