Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

save histories to different tables by one button submit

Posted on 2014-02-26
11
Medium Priority
?
270 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

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 2000 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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.
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…

722 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