473,396 Members | 2,011 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,396 software developers and data experts.

Add a detail (child) record

Hello,

I've been tasked to create a database for my wife's work and can only use Access 2000. I've created the db schema and populated lookup tables ok but am having trouble adding detail (child) records to a master (parent) record.

For simplicity's sake here's the schema:

foster_carers
===========
foster_carers_id
reference

carer
=====
carer_id
foster_carers_id (FK to foster_carers)
name

I've created several foster_carers and have manually added some carers but I want to present the forms to the user.

My three forms are:

frm_foster_carers_details - foster carers details
sub_foster_carers_carers - sub form showing some carer details for all carers for the foster carers
frm_carer_details - carer details

My frm_foster_carers_details correctly shows it's carers (via sub_foster_carers_carers). But I'm having problems adding/editing carer records.

1) How can I open the form frm_carer_details to add a new record with carer.foster_carers_id prepopulated (and unchangable)? and

2) Open the frm_carer_details form so I can edit the currently selected (or double-clicked) carer?

Any help would be much appreciated.

Cheers,

Grahame
Mar 3 '08 #1
5 2187
FishVal
2,653 Expert 2GB
Hi, Grahame.

Look at LinkChildFields and LinkMasterFields properties of the subform control.

Regards,
Fish.
Mar 3 '08 #2
NeoPa
32,556 Expert Mod 16PB
Fish's response should get you going, otherwise the wizard should create this for you if you use it.
Good luck with your project :)
Mar 4 '08 #3
Thanks both of you for your speedy responses.

In my plan to make my description simple I forgot to mention that the subform only shows partial details while the frm_carer_details form shows everything for a carer.

What I'm wanting is a way to add (and edit) a carer via the frm_carer_details form. If I double-click (for editing) a carer in the subform is there a way to display the details form? Likewise if I press the * (new record) in the subform can I show the details form?

While we're on it, how do you delete records? Select a record and press Delete?

I'm sure there are thousands of databases with similar functionality but I just can't figure it out.

Sorry for not explaining myself earlier.

Cheers,

Grahame
Mar 4 '08 #4
FishVal
2,653 Expert 2GB
Ok.

That much more clearer. You just need to open the form filtered by carer (to point it to the same record as in the subform) with DoCmd.OpenForm method and set DefaultValue property of FK field to the value of FK field in the subform (or PK field in the main form) to emulate linked subform behavior.

I guess you may find interesting Add Matching Record on Filtered Form thread closely related to your issue.

Regards,
Fish
Mar 4 '08 #5
Ok.

That much more clearer. You just need to open the form filtered by carer (to point it to the same record as in the subform) with DoCmd.OpenForm method and set DefaultValue property of FK field to the value of FK field in the subform (or PK field in the main form) to emulate linked subform behavior.

I guess you may find interesting Add Matching Record on Filtered Form thread closely related to your issue.

Regards,
Fish
Fish,

Thanks for that - I'll see if I can give a whirl tonight when I finish work!

Cheers,

Grahame
Mar 4 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: mekim | last post by:
when I insert a new record into a master record - I need to update the new child record with the autonumbered ID key from the master recor Is there a simple way to do this? I insert the record -...
2
by: Coen | last post by:
Hello, I have a strange performance delay of about 2 sec's in moving to the next row. I use multiple forms with each master-detail table relations. The master-table displays it's table rows in...
5
by: PAUL | last post by:
Hello, I have 2 tables with a relationship set up in the dataset with vb ..net. I add a new record to the parent table then edit an existing child record to have the new parent ID. However when I...
2
by: Swinky | last post by:
I hope someone can help...I feel like I'm walking in the dark without a flashlight (I'm NOT a programmer but have been called to task to do some work in Access that is above my head). I have...
7
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent...
0
by: Mike Wilson | last post by:
Dear group, I have an invoice entry form, which is a simple Master fields / Detail grid. The main summary information of the invoice are stored in one table in a dataset, which is bound using a...
0
by: emalcolm_FLA | last post by:
Hello and TIA for any help with this non profit Christmas assistance project. I have an applicant (app history) and child (child history) tables (4 total). I need to grab the next available (in...
4
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase...
0
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
I want to create a master-detail scenario inside a gridview. The last column is a template column with another gridview inside it, using another datasource for child records. Which syntax should I...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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.