473,790 Members | 3,265 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A Form updating more than 1 table

11 New Member
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 4071
Andrew Thackray
76 New Member
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 programmattical ly move the field data from the recordset to the form controls and back again.
Oct 24 '06 #2
MMcCarthy
14,534 Recognized Expert Moderator MVP
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 New Member
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,reso urce2 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 Recognized Expert Moderator MVP
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
5943
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 rank a number of organisations at the same time rather than going through a form for each one. At the moment the survey has two pages. The first page allows the user to select a number of organisations from the list. This selection is
1
5963
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 updating files with about 60 to 200 rows, we get the
1
2325
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 back to the table from the form? I know it changes the query values so do I have to use an update query? I also need this to be refreshed in realtime. I have tried relationships but I find it adds a drop-down box to the table and is not really what I...
5
2227
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 (tbl_MainRegister) providing a unique identifier for documents and a means for identifying the docuement type. There are then 4 additional tables (tbl_Meetings, tbl_Documents, tbl_Project, tbl_Correspondence) which store the document details.
25
10268
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 data in each record, which includes the ID of the father and the mother (who also have records in the table). One record per form. I have a Tab Control in the form, and in one of the tabs I have a subform (sfmSiblings) in which I wish to list...
1
1833
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 disabled the MemberID key field on the form. Changing any of the fields on the form and then exiting the field effectively updates the field on the table.
1
2292
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 Email_StencilOrderer = "CA" 'Joe Bloggs Then later on when an action is taken I will call this like so:
15
7379
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 original record (which I am doing fine - getting the correct key) and I need to update the "notes" with the new value from the form, which I store in a String Variable. (I've tried storing in a Variant variable; didn't work for me)
6
9430
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 report" button located on my form to print all of the list box values (that have been updated via selection from combo boxes) from the form to the report. I've tried using a macro with the code: Macro Name: cmdGenerateReport : On Click Action:...
2
3322
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 CurrentChanged event of the BindingSource of the combobox to update the textbox. When selecting an item in the combobox or when selecting a row in the grid, it is updating the textbox correctly. The problem is when I apply a filter in the grid, and then...
0
9512
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10419
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10201
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10147
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9987
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7531
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6770
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2910
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.