Detail_OnFormat Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to format a report using certian condition in the table. I was
giving code example that uses detail on format event. it looks like this

Private Sub Detail_OnFormat (Cancel As Integer, FormatCount as Integer)
code
End Sub

This subroutine never gets executed when the report is opened. By default
thier is no Detial_OnFormat. I can select Detail for reports and under that i
have Format Print and retreat. When i try using Detail_Format i get this
error

"run time error '2191': You can't set the conrol source propery in print
preview or after printing has started".

So how do i get Detail_OnFormat to work or any other way i can format a
report using code. I have access version 10. is thier a reference i need to
set or something? thanks for any help
 
kreily said:
I'm trying to format a report using certian condition in the table. I
was giving code example that uses detail on format event. it looks
like this

Private Sub Detail_OnFormat (Cancel As Integer, FormatCount as
Integer)
code
End Sub

This subroutine never gets executed when the report is opened. By
default thier is no Detial_OnFormat. I can select Detail for reports
and under that i have Format Print and retreat. When i try using
Detail_Format i get this error

"run time error '2191': You can't set the conrol source propery in
print preview or after printing has started".

So how do i get Detail_OnFormat to work or any other way i can format
a report using code. I have access version 10. is thier a reference i
need to set or something? thanks for any help

You can set the value of an unbound control in just about any event in a report,
but you can only change the ControlSource of a bound control in the Open event.
 
"

You can set the value of an unbound control in just about any event in a report,
but you can only change the ControlSource of a bound control in the Open event.

So I'm trying to change the value of an unbound textbox when i get that
error. I tried also using the open event and that did not trigger when the
report is opened. I don't know why. i put a break point and it never stopped.
 
Back
Top