Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / October 2007

Tip: Looking for answers? Try searching our database.

Update subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bhrosey - 19 Oct 2007 18:20 GMT
I have a form to locate parts.  I also have a subform linked to a different
table to track when and how many parts were taken out of inventory.  I want
the operator to fill in the date in the main form ( because I'm using that
somewhere else also), but I want that date to populate the subform's
transaction date.  How do I keep from changing ALL the dates in the subform?
Allen Browne - 20 Oct 2007 03:05 GMT
If any of the related records in the subform had a date that did not match
the date in the parent table, would that be wrong?

If your answer is Yes, then you must not store the date in the subform's
table. Doing so breaks basic relational rules, and creates a maintenance
nightmare. Use DLookup() to get the date from the parent table instead:
   http://allenbrowne.com/casu-07.html

If your answer is No (i.e. there could be valid cases where the related
record could be different), execute an Update query statement in the
AfterUpdate event procedure of the main form to effect the change to all the
related records. You will build a query statement on-the-fly in this event,
and execute it. Here's an explanation of how to do that and suppress the
confirmation dialogs:
   http://allenbrowne.com/ser-60.html

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have a form to locate parts.  I also have a subform linked to a different
> table to track when and how many parts were taken out of inventory.  I
[quoted text clipped - 3 lines]
> transaction date.  How do I keep from changing ALL the dates in the
> subform?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.