473,946 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

updating/adding to another table

Hi,

I'm working with access and sql server.
I have two tables.
Fields in table #1: barcode
(unique),transf er_to,quantity_ of_items,suppli er,price,date_o f_shipment
Fields in table #2: barcode (unique),transf er_to(unique),q uantity_of_item s
The first table is updated manually using a form, and the second should be
updated by the form itself
at the end of each record.
Note: in table #2, "barcode" and "transfer_t o" fields are unique.
At the end of entering a record in table #1, if "barcode" and "transfer_t o"
fields exists in table #2,
I want that the "quanity_of_ite ms" field in table #1 will be added to those
in table #2. But if "barcode" and "transfer_t o" does not exist in table #2,
I want that a record will be added with the same data
(barcode,transf er_to,quantity_ of_items).
How can this be done in access/sql ?

Thanks.
Nov 12 '05 #1
1 1338
Whew!
That's a lot of cross-posting you're doing there!
It's usually considered appropriate to limit cross-posts to 2 or 3 groups.

As for your question -
is there some reason you need to keep table 2 data in a separate table?
It seems to me you could use a query (or view in SQL Server) to retrieve
this information from Table 1 on an "as needed" basis.

HTH
- Turtle

"Marius Kaizerman" <ma****@kaizerm an.org> wrote in message
news:ne******** ************@ln ews.actcom.co.i l...
Hi,

I'm working with access and sql server.
I have two tables.
Fields in table #1: barcode
(unique),transf er_to,quantity_ of_items,suppli er,price,date_o f_shipment
Fields in table #2: barcode (unique),transf er_to(unique),q uantity_of_item s
The first table is updated manually using a form, and the second should be
updated by the form itself
at the end of each record.
Note: in table #2, "barcode" and "transfer_t o" fields are unique.
At the end of entering a record in table #1, if "barcode" and "transfer_t o" fields exists in table #2,
I want that the "quanity_of_ite ms" field in table #1 will be added to those in table #2. But if "barcode" and "transfer_t o" does not exist in table #2, I want that a record will be added with the same data
(barcode,transf er_to,quantity_ of_items).
How can this be done in access/sql ?

Thanks.

Nov 12 '05 #2

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

Similar topics

2
14966
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data in the format that I need it in order to create the reports that we use. So far this has proven to be successful for the reports that I am doing and the data that I am pulling into it. I just have one challenge that may require a lot of work and I...
5
3765
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 Office 2000. I am creating a database to track student athletes. I have created the following tables. The table title is to the far left, with fields under each. The common field will be the StudentID field, which is their student number assigned...
2
3085
by: Colm O'Hagan | last post by:
Hi there, I having a problem with a database I'm setting up, I would be delighted if someone out there could help. The database I'm setting up is a task register datebase, it will be used to create work schedules for workers in a metal work shop, based on the tasks required to make a part and the tasks required to make the subcomponents of the part.
1
4301
by: travismorien | last post by:
I have four tables of different "entities". One table contains information for "people", one for "trusts", one for "companies" and one for "self managed super funds". Each type of entity has an autonumber ID, "Person ID" "Trust ID" "Company ID" and "SMSF ID" A "portfolio" table holds information about what shares, funds and properties everyone owns. But because its organised by "PersonID" it currently only can hold information for...
4
1616
by: Cyberwolf | last post by:
I have a form that users enter information into. What I want to do is to update certain fields from another table once they have entered a number in a field. The form is already based on a query as this allows the user to see only the records they entered. What would be the best approach to this? TIA, Cyberwolf
3
8099
by: wvmbark | last post by:
First time poster... I just found this forum and it appears there's plenty of people here that could make short work of problem that's been driving me absolutely bonkers for months. Every day we incur numerous service problems “Events”. Each morning we have a global conference call where events which occurred within the previous 24 hours are discussed. Prior to the call, an analyst has to review these events and provide a report, ‘The Morning...
2
2246
by: tomash | last post by:
Hi! I ve got two tables in Access 2007. I want to update a field of DataTable from another table, DataSumTable when two of their fields equals. ( the fields : Name and Period) I tried this sql code: UPDATE DataTable
4
2850
by: slavisa | last post by:
Im having trouble with updating my 1 table with the information from another! I have a table with 6 fields. Code(pk), Name, Title, Address, State, city, zip the table is called Info. Now i have a excel file which i imported it in the access db as a table called newinfo
0
2142
by: aRuaL | last post by:
Hi all, i have a problem with updating the junction table. I am doing this access project after learning for 2 weeks so pardon me if what the question im asking is really simple. Firstly i have 3 Tables: customers, projects and contracts with contracts being the junction table. I have this form allows users to add/edit the customer data and another tab to edit the project data of the user. If i were to create a new customer and projects using...
5
3111
by: rammudali | last post by:
Hi all, i have a db where i maintain document controlling. In the main form i am updating all the relevant fields(by qry- two tables i to many). for certain reason after updating a particual combobox i want to add 5 fields from this qry to a n another table. for Eg: 5 fiels of total 45 fiels from two tabels namely docno text 25, ircno text 25, rev text 10, client text 255, comments text 255 to another tblsummary afterupdating field...
0
10151
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11557
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
11152
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
11333
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,...
1
8247
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
6111
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4938
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3538
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.