Solved

save histories to different tables by one button submit

Posted on 2014-02-26
11
268 Views
Last Modified: 2014-02-26
Hi experts
 i used the following method to save the history, Please check the below link.
http://allenbrowne.com/AppAudit.html
I am able to save the history of one table records - but there is another one, which is not updating from the same form,

The function(to save history) is calling from the button submit(save), both original tables are updating with this submit button by running different queries.
And table A history is updating but Table B history is not updating.

Function call for table A history
Call AuditEditEnd("tblInvoiceA", "audTmpInvoiceA", "audInvoiceA", "InvoiceAID", Nz(Me!InvoiceAID, 0), bWasNewRecord)

Function call for table B history
 Call AuditEditEnd("tblInvoiceB", "audTmpInvoiceB", "audInvoiceB", "InvoiceBID", Nz(Me!InvoiceBID, 0), bWasNewRecord)

Both function calls are after the corresponding query updates.

Please help
0
Comment
Question by:gtmathewDallas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
11 Comments
 
LVL 28

Expert Comment

by:omgang
ID: 39889971
Please post the full button click procedure.
OM Gang
0
 

Author Comment

by:gtmathewDallas
ID: 39889994
Sure, Please see the attached file, Thanks
History.docx
0
 
LVL 28

Expert Comment

by:omgang
ID: 39890056
Clarification:  in the routine there is no audInvoiceA and audInvoiceB tables but, instead, you have table audRoom and table AudEmployee_Room_Status.  audRoom is being updated but AudEmployee_Room_Status is not.  Is this correct?
OM Gang
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 

Author Comment

by:gtmathewDallas
ID: 39890064
Yes that is correct, AudEmployee_Room_Status is not updating
0
 
LVL 28

Expert Comment

by:omgang
ID: 39890117
Try setting a break point on this line
For i = 0 To Me.List2Edit.ListCount - 1
then step through the routine to determine why the call to AuditEditEnd isn't being made.

OM Gang
0
 

Author Comment

by:gtmathewDallas
ID: 39890135
Its calling but not updating the history table
0
 
LVL 28

Expert Comment

by:omgang
ID: 39890159
Have you uncommented the
On Error GoTo
statement in the AudEditEnd rountine?  Are any errors being generated?
OM Gang
0
 
LVL 28

Accepted Solution

by:
omgang earned 500 total points
ID: 39890180
We know the function works if passed appropriate values for its expected parameters.  So something must be wrong with this call

Call AuditEditEnd("Employee_Room_Status", "AudTmpEmployee_Room_Status", "AudEmployee_Room_Status", "ID", Nz(ID, 0), bWasNewRecord)

Are you sure Nz(ID, 0) is correct?  Where is ID declared or assigned?
OM Gang
0
 

Author Closing Comment

by:gtmathewDallas
ID: 39890249
My bad.. That was the issue.. I really appreciate it Gang.. it was a great help for me..Thanks a lot OM Gang
0
 
LVL 28

Expert Comment

by:omgang
ID: 39890295
Cool.  Glad it was something simple.
OM Gang
0
 

Author Comment

by:gtmathewDallas
ID: 39890297
Yes it is :) Thanks again
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question