Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there an event right as a record is loaded? 1

Status
Not open for further replies.

chiuchimuN

Programmer
Apr 24, 2002
29
US
I want to make format changes in a report. Rather than create query after query, It would be nice if I could deal with the printing myself. Something like:

Report_CurrentRecord(Index as integer,Cancel as integer)
if Report.Field(3)="Payed" then
Text1.Color=vbBlue
End If
if Report.Field(4)=1 then
Text2="Late Fees Applied"
else
Text2="No Late fee"
End If
End Sub

Or

Report_CurrnetRecord(Index as integer, Cancel as integer)
if Index > 4000 then
Cancel=True
End Sub
 
You could make controlsource properties of text2 into an iif statement based on the above

e.g. =IIfReport.Field(4)=1 ,"Late fees apply","No Late fee")

then use the detail_print event to format the colour

e.g.

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

If Report.Field(3)="Payed" Then
Text1.Color=vbBlue

Else
End If

Hope this helps

Andy
 
Does details_print trigger only once or for each record in the recordsource?
 
effectively yes, for each instance of the details in the report(it will depend on the exact design of the report)

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top