473,395 Members | 1,377 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.

data entry in subform - fk doesn't undertake value of pk

Hello!

I have a problem with my fk's behind the main form. Here is the situation:

Table PERSONS is behind the main form and table BANK_DETAILS is behind the subform on a different tab. There is a one-to-one relationship between PERSONS with FK_ACCOUNT_CODE and BANK_DETAILS with ACCOUNT_CODE as pk in autonumber format.
When I added a new Person in the main form and I switch to the tab for the bank details, I can add a new record in BANK_DETAILS, but the value of the pk ACCOUNT_CODE would not be passed through to the fk in table PERSONS.

I am not good at programming! So what could I do?

I would be very grateful about suggestions! Thanks!
Dec 13 '07 #1
6 1421
Rabbit
12,516 Expert Mod 8TB
Check the parent/child properties of the subform control.
Dec 13 '07 #2
parent/child fields are linked. Nothing happens. Is there a possibility to write a setvalue statement for the pk control, maybe as after update event? can anybody help me with that, because I am not good at programming?

Thanks!
Jan 10 '08 #3
Rabbit
12,516 Expert Mod 8TB
I think you've got it backwards, the primary key should be in the main form while the foreign key should be in the subform.

Rather than linking the two tables on account id it should like on a person id. The way that parent/child fields work is that the field in the parent table populates the field in the child table. You should either flip the tables or change the primary key field.
Jan 10 '08 #4
Thanks for the answer!
I think I'm gonna try to switch the keys. Just one more question: might it have something to do with the tab control? I've got the tab control on the mainform and the subform is on the 2nd tab.
Jan 11 '08 #5
Alright, thanks for the answers! I changed the keys and everything is working fine!
Jan 11 '08 #6
Rabbit
12,516 Expert Mod 8TB
The tabs don't affect controls in any way other than which are visible depending on the tab you're on.

Subforms were just set up to work with the main form populating the linked field on the subform and not the other way around.
Jan 11 '08 #7

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

Similar topics

1
by: edworboys | last post by:
I have a form (Prospect) with a subform (Document). The result I am looking for is this: The user selects a prospect which is made up of Prospect Name, Country, Company and Prospect Type. They...
6
by: Wayne | last post by:
I am designing a database which needs approximately 50 fields per record. The database user requires data entry to be via a single screen. If I follow good database design practice and split the...
4
by: Krzysztof Bartosiewicz | last post by:
Hi! I haven't been using Access for a very long time and I forgot everything :) I will be very greatful for help since I have been fighting with this problem for a few hours... I have three...
5
by: lottaviano | last post by:
I am using Access 2002 and have two tables (Main and Actions) linked (in Relationships) on one field "CAL_ID" (primary key in Main Table). Main Table is a list of equipment. Actions Table lists...
2
by: Mark | last post by:
I have a form with two sub forms. The form is set to data entry. The form is bound directly to a table I have two buttons at the bottom of the screen. One button is named reject and one is named...
3
by: Darin | last post by:
I have a problem I just can't figure out. I have a form with a subform, and the recordsource of the subform has criteria based on some unbound fields in the parent form so that data in the parent...
3
by: bosmatthews | last post by:
I have a main form with a subform and a second subform nested to the first subform. The data entry property for all three forms (main, subform and sub-subform) is set to "yes" because I am intending...
1
by: NHNeedsHelp | last post by:
Hi, about to go nuts - I have a master form with 3 control buttons, user picks 1 for Const. job, 2 for Envir job and 3 for Geo job. Each button opens a subform containing the project number from...
7
by: CCHDGeek | last post by:
I have a subform that is searched according to a field value on the main form. The subform has mutiple pages and each page has a subform based off a query. Today when I logged into the main form,...
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
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
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...

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.