473,698 Members | 2,339 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update All Records in Subform

I have created a purchase order database that has a PO form with PO
Details in the subform. I need to assign each PO a job number and the
PO details subform also has a job number field (for easy of tracking
elsewhere). I have a problem where if I change the job number on the
main area of the form I need it to update ALL of the line items in the
sub form. I can get it to update the line item that currently has
focus but not the others.

Thank you for any help that you can offer.

ALWAZUP
Nov 13 '05 #1
8 4885
I'd suggest that you create a relationship between the JobNumber field in
your PO table and the JobNumber field in your Details table. Enforce
relational integrity with cascade updates. Now whenever you change the
JobNumber in a record in your PO table, all related records in your Details
table will change automagically.

HTH
- Turtle

"John" <al*****@hotmai l.com> wrote in message
news:bc******** *************** ***@posting.goo gle.com...
I have created a purchase order database that has a PO form with PO
Details in the subform. I need to assign each PO a job number and the
PO details subform also has a job number field (for easy of tracking
elsewhere). I have a problem where if I change the job number on the
main area of the form I need it to update ALL of the line items in the
sub form. I can get it to update the line item that currently has
focus but not the others.

Thank you for any help that you can offer.

ALWAZUP

Nov 13 '05 #2
al*****@hotmail .com (John) wrote in message news:<bc******* *************** ****@posting.go ogle.com>...
I have created a purchase order database that has a PO form with PO
Details in the subform. I need to assign each PO a job number and the
PO details subform also has a job number field (for easy of tracking
elsewhere). I have a problem where if I change the job number on the
main area of the form I need it to update ALL of the line items in the
sub form. I can get it to update the line item that currently has
focus but not the others.

Thank you for any help that you can offer.

ALWAZUP


Easiest way is to create a relationship betweeen the PO table and the
PO Details table and then just make sure the Cascading Updates
checkbox is checked.
Nov 13 '05 #3
Why don't you remove the job number field from the detail table, then use a
query to get the job number from the PO table?

"John" <al*****@hotmai l.com> wrote in message
news:bc******** *************** ***@posting.goo gle.com...
I have created a purchase order database that has a PO form with PO
Details in the subform. I need to assign each PO a job number and the
PO details subform also has a job number field (for easy of tracking
elsewhere). I have a problem where if I change the job number on the
main area of the form I need it to update ALL of the line items in the
sub form. I can get it to update the line item that currently has
focus but not the others.

Thank you for any help that you can offer.

ALWAZUP

Nov 13 '05 #4
I have tried to setup a relationship but it gives me an error of no
unique index found. These two forms are already linked by the PO
Number. Thanks for all of the responses so far.
Nov 13 '05 #5
If you have a unique job number for each PO number, you should be able to
create a unique index on the JobNumber field in the PO table.
"John" <al*****@hotmai l.com> wrote in message
news:bc******** *************** ***@posting.goo gle.com...
I have tried to setup a relationship but it gives me an error of no
unique index found. These two forms are already linked by the PO
Number. Thanks for all of the responses so far.

Nov 13 '05 #6
I can't do that though. There will be multiple PO's for each job number.
Nov 13 '05 #7
Guess you've run into the main reason we normalize data in Access.
The job number in your detail record is redundant, and keeping it in sync
with the parent record will always be a hassle.

As far as tracking this elsewhere, just use a query which pulls the
appropriate job number from the PO table when you need it. One approach is
to write a query which returns all of your detail information, plus the job
number (and anything else you frequently need from the parent record) and
use this anywhere you'd otherwise use your Detail table.

HTH
- Turtle

"John" <al*****@hotmai l.com> wrote in message
news:bc******** *************** ***@posting.goo gle.com...
I can't do that though. There will be multiple PO's for each job number.

Nov 13 '05 #8
You can put an Index on the JOB field that allows duplicates.

"John" <al*****@hotmai l.com> wrote in message
news:bc******** *************** ***@posting.goo gle.com...
I can't do that though. There will be multiple PO's for each job number.

Nov 13 '05 #9

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

Similar topics

1
5181
by: Kunal | last post by:
Hi, I need some help on writing an update query to update "UnitsSold" field in Products Table whenever I save a transaction. The transaction may contain several "Subtransactions", one for each product sold in that transaction. I have a subtransaction table that maintains record of each subtransaction, with data such as: ProductID, Quantity, TransactionID etc. The Products table has fields: ProductID, UnitsSold, UnitsOrdered,...
5
4697
by: Andrew | last post by:
I've got a list box that selects a record on a subform, and in that subform are a few text fiels and a button that runs an update query. How do I have the update query button run and only update the record that is selected in the list box? The data updates right, but I can't get the update query to do anything but update all of the records. Thanks, Andrew
2
5330
by: Rosy | last post by:
I have a sub-form(company name & address) that is connected to my contact listing. When I change the contact, it doesn't update the subform until I close the main form or refresh. Is there a way to make it update when I tab out of that field? Thanks.
1
2935
by: Earl Anderson | last post by:
Using WinXP & AccessXP, I'd like to automatically have the records that I've just printed in a report automatically updated to have the 'print date & time' immediately inserted into a 'Date/Time' field in the table of all of the 'just printed' records. The crude way would be to run an Update Query immediately before or immediately after printing on those records in the report, but how would I have this done automatically when hitting the...
2
1754
by: Ron | last post by:
Hi All, Okay, I've got a frmOrders with a subform of sfrmDetails. A frmClient has all the client info, plus a subform of sfrmDefaults that has the client's normal ordering defaults (like set products they always order, just no quantity). The frmClient form has a button for adding or modifying orders by popping up the frmOrders (with it's subform) and everything works well so far. I can manually input the orders, with details, etc. ...
1
7031
by: jeffro | last post by:
I have a database used for recording survey data. In the database, I have a form that displays a survey participant and a subform that is filled in by selecting a question from a looklist and then a response. The questions are held in a table and they are always the same. This is what I want to do. I want a button on the main form that can be clicked, When click, It will populate the survey detail table with the id of the record...
0
3236
by: Access Programming only with macros, no code | last post by:
ERROR MESSAGE: Could not update; currently locked by another session on this machine. BACKGROUND I have the following objects: Table1 - HO (which has about 51,000+ records) Table2 - Contact (which has 68,000+ records)
3
1527
by: natural | last post by:
Good Day, I was currently browsing on ways to update records within a form to a subform. and noted the following article by Alan Brown on how to make use of the With Me..Form.RecordsetClone .AddNew !SomeControl = SomeValue !AnotherContorl = AnotherValue 'etc. .Update End With
5
4158
by: mrubel99 | last post by:
Hi, I am working with access 2003 / XP and this is my first post to the forum and I am pretty new to Access. I have a Main single form with a subform built in. I would like to add a button on the main form that will change the yes/no fields in the records on the subform to yes. Also, if there is a filter applied, I only want to update those records that are filtered. The filters would only be of "right click-filter by selection"...
0
8674
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
8603
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
9027
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
8895
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
8861
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...
0
7725
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4369
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...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
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

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.