Hi,
I am a beginner in ACCESS and not a native English speaker, I thank you in advance for your understanding
I am at moment confronted to a weird problem.
After attempting to create a sub to append new field to my table (called here "Table1"), I have realized that the name of this table could not be modify, just after the Form switches in modus Application View (by pressing on F5 key). The message which appears says "Db Engine could not lock the table "Table1" because it is already used by an other person or another process".
This table is used in many Private Subs throught SQL Queries, but :
- those Private Subs are executed when there is an event for a control, not when pressing on F5 key...
- the query are always written in this way (set the recordset, close, set to nothing) :
Dim strSQL as String
Dim strSQL1 as DAO.Recordset
strSQL = "SELECT Field_name FROM Table1"
Set strSQL1 = CurrentDb.OpenRecordset(strSQL)
With strSQL1
If strSQL1.RecordCount > 0 Then
Forms("Name_Form").Controls("list_box_name").RowSource = strSQL 'to show all items of a column/field
Forms("Name_Form").Controls("list_box_name").Visible = True
Else: Forms("Name_Form").Controls("list_box_name").Visible = False
End If
.Close
End With
Set strSQL1 = Nothing
I have searched in every Private Subs, where this table is used, there is nothing in the "Private Sub Form_Open(Cancel As Integer)".
Nobody except me is using at moment this DB.
I really don't understand why when I press to F5, systematically when I want to change the name of Table1 (I have also tried to delete it: impossible), I have this message from ACCESS saying that the table is used somewhere in the VBA code of the Form.
Is there a way to see by which Private Sub, or when or how this Table1 is used?
Is there a way to force the lock of the table1?
I think it is one of the reason my attempt to append a new field failed. But I will maybe speak about this subject in the "Querry" category of the Forum...
I thank you a lot in advance for your help!
I am a beginner in ACCESS and not a native English speaker, I thank you in advance for your understanding
I am at moment confronted to a weird problem.
After attempting to create a sub to append new field to my table (called here "Table1"), I have realized that the name of this table could not be modify, just after the Form switches in modus Application View (by pressing on F5 key). The message which appears says "Db Engine could not lock the table "Table1" because it is already used by an other person or another process".
This table is used in many Private Subs throught SQL Queries, but :
- those Private Subs are executed when there is an event for a control, not when pressing on F5 key...
- the query are always written in this way (set the recordset, close, set to nothing) :
Dim strSQL as String
Dim strSQL1 as DAO.Recordset
strSQL = "SELECT Field_name FROM Table1"
Set strSQL1 = CurrentDb.OpenRecordset(strSQL)
With strSQL1
If strSQL1.RecordCount > 0 Then
Forms("Name_Form").Controls("list_box_name").RowSource = strSQL 'to show all items of a column/field
Forms("Name_Form").Controls("list_box_name").Visible = True
Else: Forms("Name_Form").Controls("list_box_name").Visible = False
End If
.Close
End With
Set strSQL1 = Nothing
I have searched in every Private Subs, where this table is used, there is nothing in the "Private Sub Form_Open(Cancel As Integer)".
Nobody except me is using at moment this DB.
I really don't understand why when I press to F5, systematically when I want to change the name of Table1 (I have also tried to delete it: impossible), I have this message from ACCESS saying that the table is used somewhere in the VBA code of the Form.
Is there a way to see by which Private Sub, or when or how this Table1 is used?
Is there a way to force the lock of the table1?
I think it is one of the reason my attempt to append a new field failed. But I will maybe speak about this subject in the "Querry" category of the Forum...
I thank you a lot in advance for your help!