Conditional text in group footer

M

mark.lobue

I am new to Access and am trying to figure out how to set a text
control in a group footer to "A", then change it to "B" if a
condition is met somewhere in the details of the group.
The data would look like:
Group1, Group2, Group3, "A"
Group1, Group2, Group3, "B"
Group1, Group2, Group3a, "A"
Group1, Group2, Group3a, "C"

In the footer of Group3 I have a text control, when I hit the detail
record = "B" I set the control to "B". Where I have trouble is where
do I reset the text control back to "A" at the start of the next
group, so that when the next group prints the text control displays
"A" since there was no "B". I assume it is somewhere in the non-
visible header for the 3rd group, but I have no controls in there.

Thanks,
Mark
 
M

Marshall Barton

I am new to Access and am trying to figure out how to set a text
control in a group footer to "A", then change it to "B" if a
condition is met somewhere in the details of the group.
The data would look like:
Group1, Group2, Group3, "A"
Group1, Group2, Group3, "B"
Group1, Group2, Group3a, "A"
Group1, Group2, Group3a, "C"

In the footer of Group3 I have a text control, when I hit the detail
record = "B" I set the control to "B". Where I have trouble is where
do I reset the text control back to "A" at the start of the next
group, so that when the next group prints the text control displays
"A" since there was no "B". I assume it is somewhere in the non-
visible header for the 3rd group, but I have no controls in there.


You can use the group header section's Format event to set
it. If you don't have the header section, create it and
make it invisible.
 
M

mark.lobue

You can use the group header section's Format event to set
it. If you don't have the header section, create it and
make it invisible.

Thanks, I thought it might be there, but I don't understand the
dialog. If I select [Event Procedure] it never prompts me to enter
the code. If I press the "..." next to the drop down box, it brings
up some windows that appear to be read only, I can't type anything in
them. If I try to change the view, it says a macro is running. I
think my problems are more with the Access interface on how to get
things done than the coding itself. It is like a need a step by step
on Press This, Select This, ok this is where the code goes.

Mark
 
M

mark.lobue

You can use the group header section's Format event to set
it. If you don't have the header section, create it and
make it invisible.

Thanks, I thought it might be there, but I don't understand the
dialog. If I select [Event Procedure] it never prompts me to enter
the code. If I press the "..." next to the drop down box, it brings
up some windows that appear to be read only, I can't type anything in
them. If I try to change the view, it says a macro is running. I
think my problems are more with the Access interface on how to get
things done than the coding itself. It is like a need a step by step
on Press This, Select This, ok this is where the code goes.

Mark


I think my question is even simpler than this all sounds. How do I
reference a text box value in GroupFooter2 from a procedure in
GroupHeader2? The text box is called IsComp, and if I try IsComp =
'No" I get a macro not found error.

-Mark
 
M

Marshall Barton

I think my question is even simpler than this all sounds. How do I
reference a text box value in GroupFooter2 from a procedure in
GroupHeader2? The text box is called IsComp, and if I try IsComp =
'No" I get a macro not found error.


You don't try to reference a section that will be processed
later in the report. That's why I suggested using the
group's header section.

That error usually means that you tried to enter a line of
code directly into the event property instead of in the
event procedure. The Event property (OnFormat) should
contain [Event Procedure] Then you can click on the builder
button [...] to get to the event procedure. If the report's
module appears to be read only, it might be because you have
the db open in another window??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top