DoCmd.Hourglass False
Set rs = Nothing
Set db = Nothing
Exit Sub
---In MS_Access_Professionals@yahoogroups.com, <wrmosca@...> wrote:
Phucon
Do you set db to Nothing at the end of the Sub? Maybe that pointer is hanging.
Regards,
Bill Mosca,
Founder, MS_Access_Professionals
That'll do IT http://thatlldoit.com
MS Access MVP
https://mvp.support.microsoft.com/profile=C4D9F5E7-BB03-4291-B816-64270730881E
My Nothing-to-do-with Access blog
From: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of saigonf7q5@...
Sent: Thursday, November 21, 2013 1:50 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Error 3211
When the cmdRun button is click, it runs this Sub:
Private Sub cmdRun_Click()
More code here
.
.
.
DoCmd.Hourglass True
db.TableDefs.Delete "tblTable1" 'deleting existing table
db.Execute strSql, dbFailOnError 'and creating new table with most current data
DoCmd.Hourglass False
More code here
.
.
.
End sub
It had been running ok. Then sudden, it only runs the first time, if the cmdRun is clicked again, it will generate the "Error 3211 The database engine could not lock table 'tblTable1' because it is arlready in use by another person or process."
I have to close the form, or close the application, even reboot to get it back to work.
What's the possible cause? ?
Phucon
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (4) |
Tidak ada komentar:
Posting Komentar