Table Locked by User or Process

coolcatkelso

Registered User.
Local time
Today, 23:54
Joined
Jan 5, 2009
Messages
279
Hiya guys

I'm trying to rename a few things using code -

Code:
DoCmd.Close acModule, "basValidate"
DoCmd.Close acModule, "basRunFirst"

DoCmd.SetWarnings False
DoCmd.Rename "OldAutoExec", acMacro, "AutoExec"
DoCmd.Rename "OldtblDateFlagged", acTable, "tblDateFlagged"
DoCmd.Rename "OldtblLicense", acTable, "tblLicense"
DoCmd.Rename "tblLicense", acTable, "TEMPtblLicense"
DoCmd.Rename "AutoExec", acMacro, "TEMPAutoExec"
DoCmd.SetWarnings True
DoCmd.OpenForm "frmValidate"
DoCmd.Close A_FORM, "frmValidate"

The error I get is tblDateFlagged is locked by a user or procedure

As far as I can see the table is closed.. There are no other users apart from me using this, so it can only leave a procedure / module.. I tried the following code
DoCmd.Close acModule, "basValidate"
DoCmd.Close acModule, "basRunFirst"

To attempt to close the modules but it doesn't do anything... Any ideas plz?
________
Lesbian Movie
 
Last edited:
You don't closed modules. They are not really open unless you are in design view with one open, but even then they aren't really open as you think of an object being open.

Procedures can be executing but they aren't "open."

If you have a form that has its record source based on a table or controls like combo boxes that have their record sources based on a table or query THEN the table can be open.
 
Oh, where are you executing this code from?
 
Hiya bob

The code is being executed from VBA behind a form

The Record source is based on a table

I got around the problem just now tho by renaming the module instead

Seems to work.. You have a proper way?
________
Vapir No2
 
Last edited:

Users who are viewing this thread

Back
Top Bottom