472,958 Members | 2,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Getting Information to Subform

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
5 2207
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Josh C. | last post by:
Hello everyone. I'm a bit of an Access newbie, so please bear with me. Please go to http://www.dumoti.com/access/ to view the database - 536kb. I'll go straight into examples: In the form...
1
by: Damien Ramsey | last post by:
hello there Info: I have a form on which is displayed information, customer code, address and balance etc.. on that form i also have start of the current week, which is displaying 29th march...
2
by: Simon Pleasants | last post by:
Am something of a newbie at this, so please bear with any stupid questions. I have created a database to track shipments that we import. The information is stored in a table and I have created...
1
by: xmp333 | last post by:
Hi, I have a form that is designed as a data sheet view. Attached to this is a subform with some VB code. When the user clicks on a row, the subform should pop up and run the VB code which...
1
by: xmp333 | last post by:
Hi, I have a data sheet with a subform; each time the user clicks on the "+" to show the subform, I want some code to run. I tried attaching the code to a wide variety of events, but at best...
1
by: kkrizl | last post by:
I have a form that displays general information about an alarm permit location. There's a subform that shows detailed information about burglar alarms that have gone off at the location. When a...
2
by: whitc26 | last post by:
Let me preface: I'm a novice, and have no programming experience. I have created an access database and have a few tables in it. I have created a form called "clients" This form opens up and...
1
by: sparks | last post by:
I have a form/table with an autoid it is linked to a table/form with and ID as a 1 to many. Under this form/table I need another table with many records for each on of the many in the previous...
8
Alireza355
by: Alireza355 | last post by:
Dear all, Is there a way to have a little indentation in a textbox in a subform in datasheet view? I tried this: =" " & in the recordsource, but I keep getting an error.
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.