By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,678 Members | 1,920 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,678 IT Pros & Developers. It's quick & easy.

Getting Information to Subform

P: n/a
I have a form/subform with the common one-to-many relationship.
The form allows user to display records and move to other records
via the selector, to add,delete, and edit them, with the related
records displayed in the subform going along for the ride.

The parent form's recordset has fields

string integer
COLORNAME CLASSSIZE and a few more that aren't relevant here.

The child form is related by COLORNAME.
I need CLASSSIZE to enforce *exactly* how many
records the subform will have for a particular COLORNAME
If user adds a record to the form, he needs to be kept in the subform
until he's defined CLASSSIZE, and no more, records of the 'many'-kind.
If he changes CLASSSIZE in an existing form record, he needs to be
kept at the subform level until he adds or subtracts enough records so
that the number of related records is again equal to CLASSSIZE

The form/subform was designed with a wizard, by someone other than me,
and I can't seem to communicate to the subform the form's CLASSSIZE value
(either in the underlying recordset or as the form's CLASSSIZE textbox
value). I tried to use the form's onCurrent event but I find that it
triggers after the subform gets its information--but the information I
want must be reachable because the part that's generated automatically
(getting the right COLORNAME, displaying the fields for each existing
related record in the subform) works fine. So how can I find what
that CLASSSIZE is? Right now I'm getting the value for the previous
record looked at.
thanks, --thelma
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
rkc
Thelma Lubkin wrote:
<snip>
value). I tried to use the form's onCurrent event but I find that it
triggers after the subform gets its information--but the information I
want must be reachable because the part that's generated automatically
(getting the right COLORNAME, displaying the fields for each existing
related record in the subform) works fine. So how can I find what
that CLASSSIZE is? Right now I'm getting the value for the previous
record looked at.

So reverse your method. Use the parent form's OnCurrent event to set the
value in the subform.

Me.subformControl.Form.CLASSSIZE = Me.ClassSize.Value
Nov 13 '05 #2

P: n/a
rkc <rk*@rochester.yabba.dabba.do.rr.bomb> wrote:
: Thelma Lubkin wrote:
: <snip>

:> value). I tried to use the form's onCurrent event but I find that it
:> triggers after the subform gets its information--but the information I
:> want must be reachable because the part that's generated automatically
:> (getting the right COLORNAME, displaying the fields for each existing
:> related record in the subform) works fine. So how can I find what
:> that CLASSSIZE is? Right now I'm getting the value for the previous
:> record looked at.
: So reverse your method. Use the parent form's OnCurrent event to set the
: value in the subform.
: Me.subformControl.Form.CLASSSIZE = Me.ClassSize.Value

I am using the parent form's OnCurrent event: that's the
problem; it apparently doesn't reach the parent form's
OnCurrent event until the user leaves the subform and
reenters the parent form, so I'm always one out of phase.
What you write is essentially what I'm doing.
--thelma

Nov 13 '05 #3

P: n/a
rkc
Thelma Lubkin wrote:
rkc <rk*@rochester.yabba.dabba.do.rr.bomb> wrote:
: So reverse your method. Use the parent form's OnCurrent event to set the
: value in the subform.
: Me.subformControl.Form.CLASSSIZE = Me.ClassSize.Value

I am using the parent form's OnCurrent event: that's the
problem; it apparently doesn't reach the parent form's
OnCurrent event until the user leaves the subform and
reenters the parent form, so I'm always one out of phase.
What you write is essentially what I'm doing.
--thelma

Well then you are doing something unconventional that you are not
mentioning or don't realize you are doing.
Nov 13 '05 #4

P: n/a
rkc <rk*@rochester.yabba.dabba.do.rr.bomb> wrote:
: Thelma Lubkin wrote:
:> rkc <rk*@rochester.yabba.dabba.do.rr.bomb> wrote:

:>
:> : So reverse your method. Use the parent form's OnCurrent event to set the
:> : value in the subform.
:> : Me.subformControl.Form.CLASSSIZE = Me.ClassSize.Value
:>
:> I am using the parent form's OnCurrent event: that's the
:> problem; it apparently doesn't reach the parent form's
:> OnCurrent event until the user leaves the subform and
:> reenters the parent form, so I'm always one out of phase.
:> What you write is essentially what I'm doing.
:> --thelma
:>
: Well then you are doing something unconventional that you are not
: mentioning or don't realize you are doing.

You're right: I figured it out while at an organ recital
listening to a Bach fugue. I did 'essentially' what you
show, not precisely. I introduced something so ridiculous
that I don't now understand why I thought I needed to do it.
I decided that I had to assign CLASSSIZE to a variable in
the parent form and to use that variable in the child form.
...and then I couldn't find an event where I could assign
the variable early enough to make it useful.
thanks for waking me up,
--thelma
Nov 13 '05 #5

P: n/a
rkc
Thelma Lubkin wrote:
rkc <rk*@rochester.yabba.dabba.do.rr.bomb> wrote:
: Thelma Lubkin wrote:
:> rkc <rk*@rochester.yabba.dabba.do.rr.bomb> wrote:

:>
:> : So reverse your method. Use the parent form's OnCurrent event to set the
:> : value in the subform.
:> : Me.subformControl.Form.CLASSSIZE = Me.ClassSize.Value
:>
:> I am using the parent form's OnCurrent event: that's the
:> problem; it apparently doesn't reach the parent form's
:> OnCurrent event until the user leaves the subform and
:> reenters the parent form, so I'm always one out of phase.
:> What you write is essentially what I'm doing.
:> --thelma
:>
: Well then you are doing something unconventional that you are not
: mentioning or don't realize you are doing.

You're right: I figured it out while at an organ recital
listening to a Bach fugue. I did 'essentially' what you
show, not precisely. I introduced something so ridiculous
that I don't now understand why I thought I needed to do it.
I decided that I had to assign CLASSSIZE to a variable in
the parent form and to use that variable in the child form.
...and then I couldn't find an event where I could assign
the variable early enough to make it useful.
thanks for waking me up,
--thelma


Cool.

I usually figure things out drinking Genesee beer and listening to AC/DC.


Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.