473,786 Members | 2,578 Online
Bytes | Software Development & Data Engineering Community
+ 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 2255
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.subformContr ol.Form.CLASSSI ZE = Me.ClassSize.Va lue
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.subformContr ol.Form.CLASSSI ZE = Me.ClassSize.Va lue

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.subformContr ol.Form.CLASSSI ZE = Me.ClassSize.Va lue

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.subformContr ol.Form.CLASSSI ZE = Me.ClassSize.Va lue
:>
:> 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.subformContr ol.Form.CLASSSI ZE = Me.ClassSize.Va lue
:>
:> 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
1584
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 NIGO_ITEM, you'll notice a subform to the NIGO_REASONS table. It won't let any data be entered into this subform and it gives the error: You cannot add or change a record because a related record is required in table CUSTOMER_TABLE. (Error 3201) This...
1
1979
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 2004 today for instance. this text box is active, what i mean is when i press the plus or minus keys this text box moves up and down one week. now i also have on this form a subform of sales, which is a customers weekly orders, this displays...
2
3161
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 a form which displays the information from the table. The end users have access to the form only - this is deliberate. I have created some queries, including parameter queries, to aid them which are accessible via buttons on the main form. ...
1
3733
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 accesses the record corresponding to the row clicked. To get this row, I tried using Me.Parent.Bookmark. Unfortunately, this gets the "Current Record" which is set via the navigation
1
1352
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 they only ran the first time the subform popped up. How can I get the desired behavior? Is there an event I missed or is it more complex?
1
2700
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 new alarm is entered on the subform, I want to print a report that shows the general information and the alarms that were entered. The record source for the form is the Mailing List table (key is Alarm #). The record source for the subform is the...
2
2559
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 has alot of basic client information in it, nothing fancy, no code (other than what access has put in). I have created a second form "newVisit" This form has a subform on it called "client visit subform". The form is just to be used to record...
1
1608
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 table. form1 form2 form3 table1 table2 table3 autoid -1-------------@ ID -1-----------------@- ID2 of course it won't allow this so I put in a second ID
8
11626
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
9496
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9961
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7512
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6745
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.