Does anyone know of a good and faultproof way to carry the field content of a form to another form that is based on diferent tables. For e.g. I have a frmCustomer where I store information on a customer (based on tblCustomers). How can I then carry over the CustomerID from the frmCustomer to frmTransactions (based on tblTransaction and is using CustomerID as a foreign key). I’ve been storing the currentcustid as global variable and using the OnCurrent event to copy customerID to currentcustid. It works but it is not always faultproof especially when a user click on the cmd button to open frmtransaction before frmCustomer is updated with the new customerid. I hope I am making sense to someone.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Carrying field content from one form to another (Access 2K)
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Carrying field content from one form to another (Access 2K)
- This topic has 6 replies, 2 voices, and was last updated 20 years, 7 months ago.
AuthorTopicWSkucingtidur
AskWoody LoungerOctober 7, 2004 at 9:12 pm #410801Viewing 3 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerOctober 7, 2004 at 9:18 pm #886078If you haven’t done so yet, create a relationship between tblCustomers and tblTransaction on the CustomerID field
Tick the ‘Enforce Referential Integrity’ and ‘Cascade Update Related Fields’ check boxes, then click OK.
This will ensure that if you modify a CustomerID in tblCustomers, it will also be modified in all related records in tblTransaction. No code needed. -
WSHansV
AskWoody LoungerOctober 7, 2004 at 9:18 pm #886079If you haven’t done so yet, create a relationship between tblCustomers and tblTransaction on the CustomerID field
Tick the ‘Enforce Referential Integrity’ and ‘Cascade Update Related Fields’ check boxes, then click OK.
This will ensure that if you modify a CustomerID in tblCustomers, it will also be modified in all related records in tblTransaction. No code needed. -
WSkucingtidur
AskWoody LoungerOctober 8, 2004 at 8:02 pm #886349the scenario that i have in my database is slightly crazy. i have pets (tblpets) who don’t always have an owner (tblcustomers) but there are cases where a customer will own more than one pets or a customer may not even have a pet coz they called to complain about some else’s pet. so, there is no direct way for me to relate tblpets to tblcustomers. i am trying to relate tblcustomer to tblpet by using a middle table called tbltransaction. i can directly relate a pet to tbltransaction because a transaction will always involve a pet. but a customer may not always be involve in a transaction. when a transaction does involve a customer i would like for my users to transfer the customerid on frmcustomer to the customerid field on frmtransaction. there is a need for me to relate tblcustomers to tblpets in some way because my users would like to know which pet is owned by who if there is an owner. to a novice like me, this is scenario is driving me bonkers! is there a better way for me to design the database so i can easilt separate out the owners from the non-owners and still have my users filled out the customer info in one place?
-
WSHansV
AskWoody LoungerOctober 8, 2004 at 10:31 pm #886408I would include an OwnerID field in tblPets, linked to CustomerID in tblCustomers. If the pet has an owner, you fill in the OwnerID, otherwise leave it blank. I would include a CustomerID field in tblTransaction, linked to CustomerID in tblCustomers and a PetID field linked to PetID in tblPets. Set ‘enforce referential integrity’ and ‘cascade update related fields’ for all l relationships. Note that OwnerID in tblPets is NOT linked to CustomerID in tblTransaction, as explained by you.
You could make sure that the current record in the customers form has been saved before the transaction form is opened from the command button:
If Me.Dirty Then
RunCommand acCmdSaveRecord
End If
DoCmd.OpenForm “…” -
WSHansV
AskWoody LoungerOctober 8, 2004 at 10:31 pm #886409I would include an OwnerID field in tblPets, linked to CustomerID in tblCustomers. If the pet has an owner, you fill in the OwnerID, otherwise leave it blank. I would include a CustomerID field in tblTransaction, linked to CustomerID in tblCustomers and a PetID field linked to PetID in tblPets. Set ‘enforce referential integrity’ and ‘cascade update related fields’ for all l relationships. Note that OwnerID in tblPets is NOT linked to CustomerID in tblTransaction, as explained by you.
You could make sure that the current record in the customers form has been saved before the transaction form is opened from the command button:
If Me.Dirty Then
RunCommand acCmdSaveRecord
End If
DoCmd.OpenForm “…”
-
-
WSkucingtidur
AskWoody LoungerOctober 8, 2004 at 8:02 pm #886350the scenario that i have in my database is slightly crazy. i have pets (tblpets) who don’t always have an owner (tblcustomers) but there are cases where a customer will own more than one pets or a customer may not even have a pet coz they called to complain about some else’s pet. so, there is no direct way for me to relate tblpets to tblcustomers. i am trying to relate tblcustomer to tblpet by using a middle table called tbltransaction. i can directly relate a pet to tbltransaction because a transaction will always involve a pet. but a customer may not always be involve in a transaction. when a transaction does involve a customer i would like for my users to transfer the customerid on frmcustomer to the customerid field on frmtransaction. there is a need for me to relate tblcustomers to tblpets in some way because my users would like to know which pet is owned by who if there is an owner. to a novice like me, this is scenario is driving me bonkers! is there a better way for me to design the database so i can easilt separate out the owners from the non-owners and still have my users filled out the customer info in one place?
Viewing 3 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Cox Communications and Charter Communications to merge
by
not so anon
2 hours, 4 minutes ago -
Help with WD usb driver on Windows 11
by
Tex265
1 hour, 11 minutes ago -
hibernate activation
by
e_belmont
4 hours, 57 minutes ago -
Red Hat Enterprise Linux 10 with AI assistant
by
Alex5723
8 hours, 45 minutes ago -
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
11 hours, 49 minutes ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
11 hours, 51 minutes ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
15 hours, 1 minute ago -
Out of band for Windows 10
by
Susan Bradley
16 hours, 34 minutes ago -
Giving UniGetUi a test run.
by
RetiredGeek
23 hours, 31 minutes ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
1 day, 7 hours ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
1 day, 5 hours ago -
Auto Time Zone Adjustment
by
wadeer
1 day, 11 hours ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
1 day, 9 hours ago -
Manage your browsing experience with Edge
by
Mary Branscombe
13 hours, 53 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
2 hours, 19 minutes ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
8 hours, 43 minutes ago -
Apps included with macOS
by
Will Fastie
6 hours, 35 minutes ago -
Xfinity home internet
by
MrJimPhelps
3 hours, 22 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
1 day, 4 hours ago -
Debian 12.11 released
by
Alex5723
2 days, 8 hours ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
2 days, 12 hours ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
1 day, 15 hours ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
1 hour, 15 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
3 days, 5 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
2 days, 19 hours ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
17 hours, 30 minutes ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
3 days ago -
Some advice for managing my wireless internet gateway
by
LHiggins
2 days, 7 hours ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
1 day, 9 hours ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
3 days, 17 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.