473,387 Members | 1,501 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,387 software developers and data experts.

Adding to multiple tables

In my form I have it bringing up record information from 2 differant
tables and that works just fine. The problem is when I try to add a
new set of information it only adds the key to the one table and not
the other.

Apr 20 '06 #1
3 1204
wp*****@hotmail.com wrote:
In my form I have it bringing up record information from 2 differant
tables and that works just fine. The problem is when I try to add a
new set of information it only adds the key to the one table and not
the other.

I'll assume this is a one-to-one link, not using a subform. Let's say
the field is ID in both. Make sure the link to table2's ID is on the
form, make it invisible. In your recordsource maybe call it Table2ID.
Table2ID : Table2!ID
In the BeforeUpdate event of the form, if it's passed all of the
verification checks, then update the key. Ex:
If Cancel = False And Me.NewRecord then
Me.Table2ID = Me.ID
End If
Apr 20 '06 #2
What is confusing me is that I have a relationship setup between the 2
tables aswell as a link between them in the query. I thought that
would be enough for it to do what I want.

Apr 20 '06 #3
wp*****@hotmail.com wrote:
What is confusing me is that I have a relationship setup between the 2
tables aswell as a link between them in the query. I thought that
would be enough for it to do what I want.

But its obvious it isn't. Relationships between tables does not mean
each record has matching records in another table.
Apr 20 '06 #4

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

Similar topics

6
by: Jamie Fryatt | last post by:
Hi everyone, here's what id like to do. I have a table with 2 fields, name and value I need to be able to add multiple records quickly, for example I need to add name value abc 1...
3
by: LouD | last post by:
I have 5 tables in my db and when i bring up the linked form I get my product lists Tbls are tbStock, which contain unitcost, sellprice n qty tblProduct, contains ID, medicalname n genericname...
2
by: dixie | last post by:
I have a report which is printed daily. It is a list of people. A person can be put on this list for one day, which is easyily achieved from a simple form. My problem is that a person can also...
5
by: Sami | last post by:
Please bear with me, and if you answer this question, please do it step by step. I am new at Access, not at all sophisticated. I am using Office XP. This will need to be read in Access for...
4
by: Mike Hnatt | last post by:
My goal is to get data from an XML file into a couple of tables in an Access database. The XML file is a little complex so I need control over what I do (I can't just read it into a dataset). ...
3
by: Chris | last post by:
Hi, I am trying to load 3 xml files into one dataset like dsXML.ReadXml(Server.MapPath("file1.xml") dsXML.ReadXml(Server.MapPath("file2.xml")) dsXML.ReadXml(Server.MapPath("file3.xml")) I am...
6
by: Mark | last post by:
I'm trying to add a table to a dataset but get the error: "A DataTable named 'BordDates0040' already belongs to this DataSet." Code: Dim dtBordDates As DataTable dtBordDates =...
8
by: shumaker | last post by:
I'm wondering if adding an autonumber primary key will improve the performance of a multiuser access database on a network share. I have a website that lists many tips for improving performance of...
1
by: access345 | last post by:
I am trying to add a record to multiple tables at the same time. My current Code created multiple records in the same table. I am trying two different methods with no results: Public Sub...
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
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
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...

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.