Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
| FAQ | Members List | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #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



Reply With Quote
  #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.


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 08:01 AM.

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