Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
| Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 17th, 2008, 05:48 AM
Friend of Wrox
Join Date: Apr 2007
Location: , , .
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default Access application exit button generate lock


I've spend lot of time but I can't find an answer how to reslove this lock issue

When click on exit button creates Lock on SQL
Here's code

* NOTE This code is on Form X after updating values on FormX , Customer Form
Updates Values

Sub Exit_Click()
On Error Resume Next
Dim passed As Boolean
RunCommand acCmdSaveRecord -- Error (it take long time to save)
Me!TotalValue = order_val(Me!MID, Me!Date, passed)
DoCmd.Close acForm, Me.Name -- Error (again it take long time here)
End Sub

On close event

Private Sub Form_Unload(Cancel As Integer)
update_localorder Me!MID
Forms!Customers.SubReport.Requery-- Error (It takes time here as well)
End Sub

On SQL server activity monitor it shows
Command --> Update
Wait type --> LCK_M_X
RID --> 6:1:76550:9

and after 1 or 2 minutes lock reslove itself...

This issue is not 100% consistant, sometimes there's no issue in closing forms

Any suggestion



  #2 (permalink)  
Old June 17th, 2008, 10:28 AM
Friend of Wrox
Join Date: Apr 2007
Location: , , .
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda


Check Table have dependencies or not
Check what dependencies are i.e view , table
If view then change select statement with No lock

select * from .... WITH (nolock)

Make sure view which linked with access are not updateable from Access application otherwise create duplicate records if opened or changed by any other user session.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force users to exit access application giswim Access 10 January 31st, 2014 04:27 AM
Application.exit() fails to terminate application. saumya General .NET 1 January 4th, 2008 09:50 AM
Exit Application King_ General .NET 0 February 23rd, 2006 10:30 AM
Use of Active lock 1.6 and Generate Key eresina Pro VB 6 5 April 5th, 2004 06:43 AM
Application.Exit() Help rodmcleay C# 2 October 8th, 2003 07:54 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.