Using report values in Event Procedure

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

Guest

I have a Report based on a Query. The Report has a group header with an Event
Procedure for "On Format" property. In the Event Procedure I want to access
some of the fields that are displayed and printed in the report i.e
Last_Use_LOC. I've tried a few different methods, 2 are listed below with
their associated error:

Me![Last_Use_LOC].Value - Error 2465: "Microsoft Access can't find the field
'Last_Use_LOC' referred to in your expression."

Me.Last_Use_LOC.Value - Error 94: "Invalid use of Null"

Is there a way that I can access the contents of these fields?
 
Hi,
second one:
Me.Last_Use_LOC.Value - Error 94: "Invalid use of Null"

shows that control was accessed, but perhaps you use in expression, and
assign its value to a variable, that does not accept null.
if you give more info on what you are doing, and what code you have - we can
perhaps give more help
 
I continued to work on it. Somehow I got it to work. I needed to create a
text box in the report that contained the field that I wanted to use as the
"Control Source", then I could use the name of the Text box. The statement
below now works if written as follows:
Me![Last_Use_Date].Text

Alex Dybenko said:
Hi,
second one:
Me.Last_Use_LOC.Value - Error 94: "Invalid use of Null"

shows that control was accessed, but perhaps you use in expression, and
assign its value to a variable, that does not accept null.
if you give more info on what you are doing, and what code you have - we can
perhaps give more help

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


WilliamM said:
I have a Report based on a Query. The Report has a group header with an
Event
Procedure for "On Format" property. In the Event Procedure I want to
access
some of the fields that are displayed and printed in the report i.e
Last_Use_LOC. I've tried a few different methods, 2 are listed below with
their associated error:

Me![Last_Use_LOC].Value - Error 2465: "Microsoft Access can't find the
field
'Last_Use_LOC' referred to in your expression."

Me.Last_Use_LOC.Value - Error 94: "Invalid use of Null"

Is there a way that I can access the contents of these fields?
 
WilliamM said:
I continued to work on it. Somehow I got it to work. I needed to create a
text box in the report that contained the field that I wanted to use as
the
"Control Source", then I could use the name of the Text box. The statement
below now works if written as follows:
Me![Last_Use_Date].Text

Alex Dybenko said:
Hi,
second one:
Me.Last_Use_LOC.Value - Error 94: "Invalid use of Null"

shows that control was accessed, but perhaps you use in expression, and
assign its value to a variable, that does not accept null.
if you give more info on what you are doing, and what code you have - we
can
perhaps give more help

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


WilliamM said:
I have a Report based on a Query. The Report has a group header with an
Event
Procedure for "On Format" property. In the Event Procedure I want to
access
some of the fields that are displayed and printed in the report i.e
Last_Use_LOC. I've tried a few different methods, 2 are listed below
with
their associated error:

Me![Last_Use_LOC].Value - Error 2465: "Microsoft Access can't find the
field
'Last_Use_LOC' referred to in your expression."

Me.Last_Use_LOC.Value - Error 94: "Invalid use of Null"

Is there a way that I can access the contents of these fields?
 
But do not forget that:
Me![Last_Use_Date].Text

works only when textbox has a focus!

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


WilliamM said:
I continued to work on it. Somehow I got it to work. I needed to create a
text box in the report that contained the field that I wanted to use as
the
"Control Source", then I could use the name of the Text box. The statement
below now works if written as follows:
Me![Last_Use_Date].Text

Alex Dybenko said:
Hi,
second one:
Me.Last_Use_LOC.Value - Error 94: "Invalid use of Null"

shows that control was accessed, but perhaps you use in expression, and
assign its value to a variable, that does not accept null.
if you give more info on what you are doing, and what code you have - we
can
perhaps give more help

--
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com


WilliamM said:
I have a Report based on a Query. The Report has a group header with an
Event
Procedure for "On Format" property. In the Event Procedure I want to
access
some of the fields that are displayed and printed in the report i.e
Last_Use_LOC. I've tried a few different methods, 2 are listed below
with
their associated error:

Me![Last_Use_LOC].Value - Error 2465: "Microsoft Access can't find the
field
'Last_Use_LOC' referred to in your expression."

Me.Last_Use_LOC.Value - Error 94: "Invalid use of Null"

Is there a way that I can access the contents of these fields?
 
Back
Top