473,493 Members | 2,245 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 2231
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
1562
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
1953
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
3140
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
3715
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
1338
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
2665
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
2530
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
1596
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
11575
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
7119
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6989
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4889
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
644
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.