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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

On Format vs. On Print

Status
Not open for further replies.

RSfromCO

Programmer
May 3, 2002
149
US
Can anyone provide me with some basic information on when to use the On Format method, vs. when to use the On Print method when trying to do some formatting of fields in code?

I am trying to compare values in a record with values in the previous record (such as dates, to see if there was a gap between dates, etc.).

It appears that the On Format method gets called multiple times. But I'm not sure exactly how many times, and when.

I am trying to determine if a record is the "First" record in the report (vs. being the first record on this page). And I'm having a bit of difficulty telling that.

Is there a to a description of how the On Format method works vs. the On Print ???
 
To find out if a record is the first record in a report, add a text box to the detail section:
Name: txtSeq
Control Source: =1
Running Sum: Over All
Visible: No
You can then check in the On Format event to see
If Me.txtSeq = 1 Then
'this is the first record
Else

End If

You can't change format properties in the On Print event.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top