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

A Form updating more than 1 table

11
I have only updated 1 table with a Form to date
Can you update more than 1 table from a single Form input?
The Wizard seems to allow only 1 Table to be selected as the data source
If so any quick pointers would be useful
Many thanks
Oct 24 '06 #1
4 4050
A form can only be bound to one record source. However if you can join the two tables in an updateable query you can point the form to the query and update fields from both tables. Otherwise you will have to update the second table in VBA by opening a recordset to the second table and programmattically move the field data from the recordset to the form controls and back again.
Oct 24 '06 #2
MMcCarthy
14,534 Expert Mod 8TB
I have only updated 1 table with a Form to date
Can you update more than 1 table from a single Form input?
The Wizard seems to allow only 1 Table to be selected as the data source
If so any quick pointers would be useful
Many thanks
Create a query with the the tables you want to update. There should be a one to one relationship only between the tables.

The query should be updateable.

To check open the query and make sure you can add a new record.

You can now use the query as the record source of your form.

However, its more likely that there is a one to many relationship between tables. Standard practice in dealing with this is the use of subforms.

For example:

If you had a form based on a customer table.

You could create a subform based on an order table. The order table should have a relationship through customerID with the customer table.

You should now be able to see on the subform all orders attached to this customer.
Oct 25 '06 #3
Thomadh
11
Create a query with the the tables you want to update. There should be a one to one relationship only between the tables.

The query should be updateable.

To check open the query and make sure you can add a new record.

You can now use the query as the record source of your form.

However, its more likely that there is a one to many relationship between tables. Standard practice in dealing with this is the use of subforms.

For example:

If you had a form based on a customer table.

You could create a subform based on an order table. The order table should have a relationship through customerID with the customer table.

You should now be able to see on the subform all orders attached to this customer.
Thanks for this but I cannot seem to get it working

What I have is 3 identical tables of staffnames (Resource1,resource2 and resource3) (Don't ask why it was just a simple way for me to assign up to 3 people to a task via a drop down list!)

To update staff information therefore involves 3 identical actions at present and I wanted to have 1 form which would add,amend or delete a staff member details in all 3 Tables

Hope this explains what I am trying to do!

Any ideas most welcome

Sincere thanks
Oct 26 '06 #4
MMcCarthy
14,534 Expert Mod 8TB
I hope you don't mind me saying this but your structure is terrible and is going to cause you endless problems. It would be much easier to change your structure that to keep doing what you are doing. Any union query of the three tables won't be updateable.

Suggestion:

Create a union query of the three tables. You will have to do this in SQL view of the query. Lets call it qry1.

SELECT * FROM Table1
UNION
SELECT * FROM Table2
UNION
SELECT * FROM Table3;

Now create a new query as follows and in the access design view of the query change the query type to a make table query.

SELECT * FROM qry1;

You will now have one table containing all the records.

Add a field to the table called ResourceID. Make it the AutoNumber type and set it as the primary key.

This should be your record source from now on.
Oct 26 '06 #5

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

Similar topics

4
by: Emmett Power | last post by:
Hi, I have a small online survey in two parts designed to allow users to rank a few organisations that they have dealings with from a large list of organisations. I want the users to be able to...
1
by: Srinadh | last post by:
Hi all, We have files with about 20 to 30 fields per row. We are trying to update such files with about 60 rows as contiguous data in a CLOB field. It passes through. But when we try...
1
by: Derek Davlut | last post by:
I have a Table that contains data that I use in a query to manipulte the data through expressions. I have a form that uses the query for manipulating the data. How do I write the changed values...
5
by: Steve Strik | last post by:
My Problem: I have created a database here at work that is exhibiting some very strange behaviour. Essentially the database is structured in a manner where one table is a master record table...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
1
by: Jason Wood | last post by:
Hi everyone, I've a simple table containing member details. I've written a SELECT to select all the members. I've based the form on this select, using the from wizard. Once built I've...
1
by: chrisc | last post by:
Hello, Im using redemption in a database created in ms access. At the moment emails are generated depending on various actions within a database. To give an example: Public Const...
15
by: sara | last post by:
I have a Memo field in a table to hold notes from a conversation a social worker has had with a client (this is for a non-profit). If the user needs to update the memo field, I need to find the...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
2
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi All! I am with a situation where I am not getting the right updating to the form's fields. The situation is the following one: I have one combobox and one textbox. I am using the...
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: 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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.