Solved

save histories to different tables by one button submit

Posted on 2014-02-26
11
264 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
  • 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
 

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
This collection of functions covers all the normal rounding methods of just about any numeric value.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now