Solved

save histories to different tables by one button submit

Posted on 2014-02-26
11
262 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
The new Microsoft OS looks great, is easier than ever to upgrade to, it is even free.  So what's the catch?  If you don't change the privacy settings, Microsoft will, in accordance with the (EULA) you clicked okay to without reading, collect all the…
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 …

708 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

16 Experts available now in Live!

Get 1:1 Help Now