Adding one comment on a continuous subform

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

Guest

I have a subform based on a table. The user is supposed to add numeric
values to several columns on the subform (based on criteria given in the main
form). They may need to add these numbers on one-or-many rows in the
subform. But I need them to add comments only to the first record. How can
I control this? I've tried to put the comments field on the footer, but it
changes based on the record the user clicks on in the continuous portion.
Can I make the comments disappear after the user finishes with the first
record? Can I make only the comments for the first record move to the
footer? Please let me know what options I have, and how to make it work.

Thanks!
Cathy
 
Hi Cathy

It sounds like your comments field should be in the parent table, not the
child table. Would such a design change be appropriate?

If not, then try this code in the subforms Form_Current event procedure:
txtComments.Visible = Me.CurrentRecord = 1
 
I'd say that you're going the right way with putting the comments field on
the footer, but I'd put it as an unbound control. You'll need to store the
pk value of the 'first' record somehow (not quite sure how, it depends on
the logic of why a particular record is first) and then, when you're done,
just run an SQL statement to update the comments on that record with the
text in the unbound control.
 
Both nice ideas.


Graham Mandeno said:
Hi Cathy

It sounds like your comments field should be in the parent table, not the
child table. Would such a design change be appropriate?

If not, then try this code in the subforms Form_Current event procedure:
txtComments.Visible = Me.CurrentRecord = 1

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Cathy said:
I have a subform based on a table. The user is supposed to add numeric
values to several columns on the subform (based on criteria given in the
main
form). They may need to add these numbers on one-or-many rows in the
subform. But I need them to add comments only to the first record. How
can
I control this? I've tried to put the comments field on the footer, but
it
changes based on the record the user clicks on in the continuous portion.
Can I make the comments disappear after the user finishes with the first
record? Can I make only the comments for the first record move to the
footer? Please let me know what options I have, and how to make it work.

Thanks!
Cathy
 
Normally I would absolutely agree with you. Unfortunately, this user wants
the comments on each line EXCEPT under one circumstance... and that's the
work around I'm trying to fix.

Graham Mandeno said:
Hi Cathy

It sounds like your comments field should be in the parent table, not the
child table. Would such a design change be appropriate?

If not, then try this code in the subforms Form_Current event procedure:
txtComments.Visible = Me.CurrentRecord = 1

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Cathy said:
I have a subform based on a table. The user is supposed to add numeric
values to several columns on the subform (based on criteria given in the
main
form). They may need to add these numbers on one-or-many rows in the
subform. But I need them to add comments only to the first record. How
can
I control this? I've tried to put the comments field on the footer, but
it
changes based on the record the user clicks on in the continuous portion.
Can I make the comments disappear after the user finishes with the first
record? Can I make only the comments for the first record move to the
footer? Please let me know what options I have, and how to make it work.

Thanks!
Cathy
 
It works perfectly! Thank you!

Graham Mandeno said:
Hi Cathy

It sounds like your comments field should be in the parent table, not the
child table. Would such a design change be appropriate?

If not, then try this code in the subforms Form_Current event procedure:
txtComments.Visible = Me.CurrentRecord = 1

--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

Cathy said:
I have a subform based on a table. The user is supposed to add numeric
values to several columns on the subform (based on criteria given in the
main
form). They may need to add these numbers on one-or-many rows in the
subform. But I need them to add comments only to the first record. How
can
I control this? I've tried to put the comments field on the footer, but
it
changes based on the record the user clicks on in the continuous portion.
Can I make the comments disappear after the user finishes with the first
record? Can I make only the comments for the first record move to the
footer? Please let me know what options I have, and how to make it work.

Thanks!
Cathy
 
Back
Top