473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Loops for Parent/Child relationships

Thank you in advance for all your assistance, it is GREATLY appreciated. I'm
writing a small Access 2000 program for tracking Kennel Litters for a friend
and I'm wondering how I can loop through all records from a Parent form to the
Child form with a matching Parent Child relationship.

What I'm trying to do is make it where she can check a box or hit a command
button, loop through all the child records with the same ParentID as the
foreign ChildID and update Date, Procedure and other various information.

Example: Shot for one dog, will be same for all the dogs in that litter.
Instead of having to enter each shot individually, a checkbox or command button
could be used to enter all similar shots/procedures for the complete litter?

Michael
Nov 12 '05 #1
3 2757
Lumpierbritches wrote:
Thank you in advance for all your assistance, it is GREATLY appreciated. I'm
writing a small Access 2000 program for tracking Kennel Litters for a friend
and I'm wondering how I can loop through all records from a Parent form to the
Child form with a matching Parent Child relationship.

What I'm trying to do is make it where she can check a box or hit a command
button, loop through all the child records with the same ParentID as the
foreign ChildID and update Date, Procedure and other various information.

Example: Shot for one dog, will be same for all the dogs in that litter.
Instead of having to enter each shot individually, a checkbox or command button
could be used to enter all similar shots/procedures for the complete litter?

Michael


For 'loop through all records' which is a procedural expression,
relational databases use update statements (queries, in Access).

You can create a query that updates a field in every record conforming
to certain criteria. I don't know what a litter is, but if you have an
expression for one litter, you can put that in the criteria row with the
update query.

Play with it, maybe you get the hang of it.

--
Bas Cost Budde
http://www.heuveltop.org/BasCB
but the domain is nl

Nov 12 '05 #2
Lumpierbritches wrote:
Thank you in advance for all your assistance, it is GREATLY appreciated. I'm
writing a small Access 2000 program for tracking Kennel Litters for a friend
and I'm wondering how I can loop through all records from a Parent form to the
Child form with a matching Parent Child relationship.

What I'm trying to do is make it where she can check a box or hit a command
button, loop through all the child records with the same ParentID as the
foreign ChildID and update Date, Procedure and other various information.

Example: Shot for one dog, will be same for all the dogs in that litter.
Instead of having to enter each shot individually, a checkbox or command button
could be used to enter all similar shots/procedures for the complete litter?

Michael

Dim db as database
Dim SQLString as string

Set db=CurrentDB
SQLString = "UPDATE ChildRecord SET ChildRecord.ShotDate = #" &
Me!DateOfShot & #"
SQLString = SQLString & " WHERE ChildRecord.ParentID= " & Me!ParentID & ";"
DB.Execute SQLString

This is air code.

Ron

--
Ronald W. Roberts
Roberts Communication
rw*******************@robcom.com
To reply remove "_at_robcom_dot_com"

Nov 12 '05 #3
Will you always perform the same procedure on all members of the litter? For
some procedures I would agree but for others it may be just a few of the
litter.

I would suggest an approach that would allow you to update one, more than one
or all child records with the same procedures by selecting child records. You
could provide the means to select all records by using a command button for the
list of child records or select each record that needs to be updated. Then
process only the records that were "selected" for processing.

Bill
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Lumpierbritches | last post by:
Thank you in advance for all your assistance, it is GREATLY appreciated. I'm writing a small Access 2000 program for tracking Kennel Litters for a friend and I'm wondering how I can loop through...
0
by: JJ | last post by:
Hi All, I am trying to Add nodes in code behind and am having problems with the parent child relationships. I get a Use of unassigned local variable error . I have the local variables defined...
3
by: Darryn Ross | last post by:
Hi, How do i get my datagrid to display the contents of two related tables setup in my access database, so i can see the plus/minus sign to expand retract the Child details? Regards Darryn
4
by: Danny Tuppeny | last post by:
Hi all, I've been trying to write some classes, so when I have a parent-child relationship, such as with Folders in my application, I don't have to remember to add a parent reference, as well as...
1
by: Mr Newbie | last post by:
Sorry to bother you guys but I have another questions related to DataSets. I'm almost there now, so I dont expect to bug you much more ( Hopefully ). I have Master / Details tables with...
2
by: mkidd | last post by:
Hi, I'm new at vb .net and I have an issue that must be a common one, but I haven't found an example of it yet. I want to create parent-child relationships for 3 tables...
0
by: Mr Newbie | last post by:
Sorry to bother you guys but I have another questions related to DataSets. I'm almost there now, so I dont expect to bug you much more ( Hopefully ). I have Master / Details tables with...
3
by: RobKinney1 | last post by:
Hello, Thank you for reading this post. Please forgive my ignorance. This may be a simple question but am having trouble finding a straight answer. I need pass data from my Child Window back...
3
by: reachsamdurai | last post by:
Is it possible to determine the list of child/parent tables for a particular table from any system catalog tables? Using the syscat.tables I'm able to retrieve the no of dependent parent/child...
8
by: Rick | last post by:
VS 2005 I' m setting up a parent/child datagridviews in a form. I am doing a lot of this by hand coding in order to get the feel of things. I want a change in the parent table to trigger a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.