473,394 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

File / Record Lock Error !!

The Delete Event/Proc & "Save_Fields_In_Form_Header" Event/Proc in
my form were working perfectly.

However, after I added a call to the "Save_Fields_In_Form_Header"
Event/Proc in the "Current" Event of my form, and I now try to Delete
a record, I get ... Run-Time Error 3218 - Could not Update; Currently
Locked. My Access application then effectively freezes forcing me to
shut Access down & re-start.

The record DOES get deleted successfully.

What's happening is as follows:
1) I click the Delete command button on the form
2) The record gets deleted
3) The Current event gets fired & my Sub
"Save_Fields_In_Form_Header" gets called.
4) During the SQL update in the above Sub:
"Save_Fields_In_Form_Header", the above-mentioned error is triggered
on the foll statement: CurrentDb.Execute StrSql, dbFailOnError

I'm presuming here, the record is still locked by the "Delete" Event &
that's why a SQL UPDATE cannot lock the file.

I'm posting my 2 Subs here hoping someone can point out any mistakes /
workarounds.

Thx & Best Rgds,
Prakash.

----------------------------
Private Sub Save_Fields_In_Form_Header()
Dim StrSql As String

StrSql = "UPDATE JVTable SET JVTable.INV_DATE = " & _
IIf(IsNull(Me.Txt_Date),
"Null", DMY(Me.Txt_Date)) & ", " & _
"JVTable.RcdFm_PdTo = " & _

IIf(IsNull(Me.txt_RcdFm_PdTo), "Null", """" & Me.txt_RcdFm_PdTo &
"""") & ", " & _
"JVTable.Chq_No = " & _
IIf(IsNull(Me.txt_Chq_No),
"Null", """" & Me.txt_Chq_No & """") & ", " & _
"JVTable.Chq_Date = " & _

IIf(IsNull(Me.txt_Chq_Date), "Null", DMY(Me.txt_Chq_Date)) & ", " & _
"JVTable.Bank = " & _
IIf(IsNull(Me.txt_Bank),
"Null", """" & Me.txt_Bank & """") & ", " & _
"JVTable.Settled_Bill_Nos = " & _

IIf(IsNull(Me.txt_Settled_Bill_Nos), "Null", """" &
Me.txt_Settled_Bill_Nos & """")

CurrentDb.Execute StrSql, dbFailOnError

End Sub
...........................................
Private Sub Cmd_Delete_Click()
On Error GoTo Err_Cmd_Delete_Click

Dim stn As Byte, strControl As String
strControl = Screen.PreviousControl.Name
'MsgBox strControl
Application.Echo False

DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings True

Me.DrTotal = DSum("DEBIT", "JVTable") ' After deleting a Record
Totals shd be re-calculated
Me.CrTotal = DSum("CREDIT", "JVTable")

stn = Sub_Tran_No - 1 'Saving Current Record Pointer
Position
Call Cmd_ReNumber_Click 'Re-Number the sub_tran_no field if
any record is DELETED

Me.Recordset.FindFirst "[sub_tran_no]=" & stn
If Me.Recordset.NoMatch Then
Me.Recordset.MoveLast
End If
Me.Controls(strControl).SetFocus
Application.Echo True

Exit_Cmd_Delete_Click:
Exit Sub

Err_Cmd_Delete_Click:
If Err.Number = 3021 Then 'user tries to delete an EOF or BOF
record
'MsgBox "No More Records To Delete !", vbOKOnly +
vbInformation, "Message..."
Me.Controls(strControl).SetFocus
Application.Echo True
Else
MsgBox Err.Description & " " & Err.Number
End If
Resume Exit_Cmd_Delete_Click

End Sub

...........................................
Mar 3 '08 #1
5 3157
ARC
In my experience, this error has always meant that your database has a
locked / bad record and is in need of repair. In access 97, this commonly
happened in memo fields. One solution to cut down on the frequency of this
error was to put after_update code on all memo fields to have the save the
record right away. However, in multi-user environments, I found that this
error could still happen.

The fix was to repair/compact the database using the JetComp utility. The
link I have is for access 97 only: http://support.microsoft.com/kb/295334

Hope this helps,

<pr*************@gmail.comwrote in message
news:8f**********************************@e25g2000 prg.googlegroups.com...
The Delete Event/Proc & "Save_Fields_In_Form_Header" Event/Proc in
my form were working perfectly.

However, after I added a call to the "Save_Fields_In_Form_Header"
Event/Proc in the "Current" Event of my form, and I now try to Delete
a record, I get ... Run-Time Error 3218 - Could not Update; Currently
Locked. My Access application then effectively freezes forcing me to
shut Access down & re-start.

The record DOES get deleted successfully.

What's happening is as follows:
1) I click the Delete command button on the form
2) The record gets deleted
3) The Current event gets fired & my Sub
"Save_Fields_In_Form_Header" gets called.
4) During the SQL update in the above Sub:
"Save_Fields_In_Form_Header", the above-mentioned error is triggered
on the foll statement: CurrentDb.Execute StrSql, dbFailOnError

I'm presuming here, the record is still locked by the "Delete" Event &
that's why a SQL UPDATE cannot lock the file.

I'm posting my 2 Subs here hoping someone can point out any mistakes /
workarounds.

Thx & Best Rgds,
Prakash.

----------------------------
Private Sub Save_Fields_In_Form_Header()
Dim StrSql As String

StrSql = "UPDATE JVTable SET JVTable.INV_DATE = " & _
IIf(IsNull(Me.Txt_Date),
"Null", DMY(Me.Txt_Date)) & ", " & _
"JVTable.RcdFm_PdTo = " & _

IIf(IsNull(Me.txt_RcdFm_PdTo), "Null", """" & Me.txt_RcdFm_PdTo &
"""") & ", " & _
"JVTable.Chq_No = " & _
IIf(IsNull(Me.txt_Chq_No),
"Null", """" & Me.txt_Chq_No & """") & ", " & _
"JVTable.Chq_Date = " & _

IIf(IsNull(Me.txt_Chq_Date), "Null", DMY(Me.txt_Chq_Date)) & ", " & _
"JVTable.Bank = " & _
IIf(IsNull(Me.txt_Bank),
"Null", """" & Me.txt_Bank & """") & ", " & _
"JVTable.Settled_Bill_Nos = " & _

IIf(IsNull(Me.txt_Settled_Bill_Nos), "Null", """" &
Me.txt_Settled_Bill_Nos & """")

CurrentDb.Execute StrSql, dbFailOnError

End Sub
..........................................
Private Sub Cmd_Delete_Click()
On Error GoTo Err_Cmd_Delete_Click

Dim stn As Byte, strControl As String
strControl = Screen.PreviousControl.Name
'MsgBox strControl
Application.Echo False

DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings True

Me.DrTotal = DSum("DEBIT", "JVTable") ' After deleting a Record
Totals shd be re-calculated
Me.CrTotal = DSum("CREDIT", "JVTable")

stn = Sub_Tran_No - 1 'Saving Current Record Pointer
Position
Call Cmd_ReNumber_Click 'Re-Number the sub_tran_no field if
any record is DELETED

Me.Recordset.FindFirst "[sub_tran_no]=" & stn
If Me.Recordset.NoMatch Then
Me.Recordset.MoveLast
End If
Me.Controls(strControl).SetFocus
Application.Echo True

Exit_Cmd_Delete_Click:
Exit Sub

Err_Cmd_Delete_Click:
If Err.Number = 3021 Then 'user tries to delete an EOF or BOF
record
'MsgBox "No More Records To Delete !", vbOKOnly +
vbInformation, "Message..."
Me.Controls(strControl).SetFocus
Application.Echo True
Else
MsgBox Err.Description & " " & Err.Number
End If
Resume Exit_Cmd_Delete_Click

End Sub

..........................................

Mar 3 '08 #2
ARC
By the way, if you search through the table and focus in on the memo field,
look for #error in the table. This will indicate the locked/bad record.
<pr*************@gmail.comwrote in message
news:8f**********************************@e25g2000 prg.googlegroups.com...
The Delete Event/Proc & "Save_Fields_In_Form_Header" Event/Proc in
my form were working perfectly.

However, after I added a call to the "Save_Fields_In_Form_Header"
Event/Proc in the "Current" Event of my form, and I now try to Delete
a record, I get ... Run-Time Error 3218 - Could not Update; Currently
Locked. My Access application then effectively freezes forcing me to
shut Access down & re-start.

The record DOES get deleted successfully.

What's happening is as follows:
1) I click the Delete command button on the form
2) The record gets deleted
3) The Current event gets fired & my Sub
"Save_Fields_In_Form_Header" gets called.
4) During the SQL update in the above Sub:
"Save_Fields_In_Form_Header", the above-mentioned error is triggered
on the foll statement: CurrentDb.Execute StrSql, dbFailOnError

I'm presuming here, the record is still locked by the "Delete" Event &
that's why a SQL UPDATE cannot lock the file.

I'm posting my 2 Subs here hoping someone can point out any mistakes /
workarounds.

Thx & Best Rgds,
Prakash.

----------------------------
Private Sub Save_Fields_In_Form_Header()
Dim StrSql As String

StrSql = "UPDATE JVTable SET JVTable.INV_DATE = " & _
IIf(IsNull(Me.Txt_Date),
"Null", DMY(Me.Txt_Date)) & ", " & _
"JVTable.RcdFm_PdTo = " & _

IIf(IsNull(Me.txt_RcdFm_PdTo), "Null", """" & Me.txt_RcdFm_PdTo &
"""") & ", " & _
"JVTable.Chq_No = " & _
IIf(IsNull(Me.txt_Chq_No),
"Null", """" & Me.txt_Chq_No & """") & ", " & _
"JVTable.Chq_Date = " & _

IIf(IsNull(Me.txt_Chq_Date), "Null", DMY(Me.txt_Chq_Date)) & ", " & _
"JVTable.Bank = " & _
IIf(IsNull(Me.txt_Bank),
"Null", """" & Me.txt_Bank & """") & ", " & _
"JVTable.Settled_Bill_Nos = " & _

IIf(IsNull(Me.txt_Settled_Bill_Nos), "Null", """" &
Me.txt_Settled_Bill_Nos & """")

CurrentDb.Execute StrSql, dbFailOnError

End Sub
..........................................
Private Sub Cmd_Delete_Click()
On Error GoTo Err_Cmd_Delete_Click

Dim stn As Byte, strControl As String
strControl = Screen.PreviousControl.Name
'MsgBox strControl
Application.Echo False

DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings True

Me.DrTotal = DSum("DEBIT", "JVTable") ' After deleting a Record
Totals shd be re-calculated
Me.CrTotal = DSum("CREDIT", "JVTable")

stn = Sub_Tran_No - 1 'Saving Current Record Pointer
Position
Call Cmd_ReNumber_Click 'Re-Number the sub_tran_no field if
any record is DELETED

Me.Recordset.FindFirst "[sub_tran_no]=" & stn
If Me.Recordset.NoMatch Then
Me.Recordset.MoveLast
End If
Me.Controls(strControl).SetFocus
Application.Echo True

Exit_Cmd_Delete_Click:
Exit Sub

Err_Cmd_Delete_Click:
If Err.Number = 3021 Then 'user tries to delete an EOF or BOF
record
'MsgBox "No More Records To Delete !", vbOKOnly +
vbInformation, "Message..."
Me.Controls(strControl).SetFocus
Application.Echo True
Else
MsgBox Err.Description & " " & Err.Number
End If
Resume Exit_Cmd_Delete_Click

End Sub

..........................................

Mar 3 '08 #3
On Mar 4, 3:27 am, "ARC" <PCES...@PCESoft.invalidwrote:
By the way, if you search through the table and focus in on the memo field,
look for #error in the table. This will indicate the locked/bad record.

<prakashwadhw...@gmail.comwrote in message

news:8f**********************************@e25g2000 prg.googlegroups.com...
The Delete Event/Proc & "Save_Fields_In_Form_Header" Event/Proc in
my form were working perfectly.
However, after I added a call to the "Save_Fields_In_Form_Header"
Event/Proc in the "Current" Event of my form, and I now try to Delete
a record, I get ... Run-Time Error 3218 - Could not Update; Currently
Locked. My Access application then effectively freezes forcing me to
shut Access down & re-start.
The record DOES get deleted successfully.
What's happening is as follows:
1) I click the Delete command button on the form
2) The record gets deleted
3) The Current event gets fired & my Sub
"Save_Fields_In_Form_Header" gets called.
4) During the SQL update in the above Sub:
"Save_Fields_In_Form_Header", the above-mentioned error is triggered
on the foll statement: CurrentDb.Execute StrSql, dbFailOnError
I'm presuming here, the record is still locked by the "Delete" Event &
that's why a SQL UPDATE cannot lock the file.
I'm posting my 2 Subs here hoping someone can point out any mistakes /
workarounds.
Thx & Best Rgds,
Prakash.
----------------------------
Private Sub Save_Fields_In_Form_Header()
Dim StrSql As String
StrSql = "UPDATE JVTable SET JVTable.INV_DATE = " & _
IIf(IsNull(Me.Txt_Date),
"Null", DMY(Me.Txt_Date)) & ", " & _
"JVTable.RcdFm_PdTo = " & _
IIf(IsNull(Me.txt_RcdFm_PdTo), "Null", """" & Me.txt_RcdFm_PdTo &
"""") & ", " & _
"JVTable.Chq_No = " & _
IIf(IsNull(Me.txt_Chq_No),
"Null", """" & Me.txt_Chq_No & """") & ", " & _
"JVTable.Chq_Date = " & _
IIf(IsNull(Me.txt_Chq_Date), "Null", DMY(Me.txt_Chq_Date)) & ", " & _
"JVTable.Bank = " & _
IIf(IsNull(Me.txt_Bank),
"Null", """" & Me.txt_Bank & """") & ", " & _
"JVTable.Settled_Bill_Nos = " & _
IIf(IsNull(Me.txt_Settled_Bill_Nos), "Null", """" &
Me.txt_Settled_Bill_Nos & """")
CurrentDb.Execute StrSql, dbFailOnError
End Sub
..........................................
Private Sub Cmd_Delete_Click()
On Error GoTo Err_Cmd_Delete_Click
Dim stn As Byte, strControl As String
strControl = Screen.PreviousControl.Name
'MsgBox strControl
Application.Echo False
DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings True
Me.DrTotal = DSum("DEBIT", "JVTable") ' After deleting a Record
Totals shd be re-calculated
Me.CrTotal = DSum("CREDIT", "JVTable")
stn = Sub_Tran_No - 1 'Saving Current Record Pointer
Position
Call Cmd_ReNumber_Click 'Re-Number the sub_tran_no field if
any record is DELETED
Me.Recordset.FindFirst "[sub_tran_no]=" & stn
If Me.Recordset.NoMatch Then
Me.Recordset.MoveLast
End If
Me.Controls(strControl).SetFocus
Application.Echo True
Exit_Cmd_Delete_Click:
Exit Sub
Err_Cmd_Delete_Click:
If Err.Number = 3021 Then 'user tries to delete an EOF or BOF
record
'MsgBox "No More Records To Delete !", vbOKOnly +
vbInformation, "Message..."
Me.Controls(strControl).SetFocus
Application.Echo True
Else
MsgBox Err.Description & " " & Err.Number
End If
Resume Exit_Cmd_Delete_Click
End Sub
..........................................


I don't have any memo fields in my table. Hope you have any other
ideas ??

Best Rgds,
Prakash.
Mar 4 '08 #4
On Mar 4, 9:41 am, prakashwadhw...@gmail.com wrote:
On Mar 4, 3:27 am, "ARC" <PCES...@PCESoft.invalidwrote:
By the way, if you search through the table and focus in on the memo field,
look for #error in the table. This will indicate the locked/bad record.
<prakashwadhw...@gmail.comwrote in message
news:8f**********************************@e25g2000 prg.googlegroups.com...
The Delete Event/Proc & "Save_Fields_In_Form_Header" Event/Proc in
my form were working perfectly.
However, after I added a call to the "Save_Fields_In_Form_Header"
Event/Proc in the "Current" Event of my form, and I now try to Delete
a record, I get ... Run-Time Error 3218 - Could not Update; Currently
Locked. My Access application then effectively freezes forcing me to
shut Access down & re-start.
The record DOES get deleted successfully.
What's happening is as follows:
1) I click the Delete command button on the form
2) The record gets deleted
3) The Current event gets fired & my Sub
"Save_Fields_In_Form_Header" gets called.
4) During the SQL update in the above Sub:
"Save_Fields_In_Form_Header", the above-mentioned error is triggered
on the foll statement: CurrentDb.Execute StrSql, dbFailOnError
I'm presuming here, the record is still locked by the "Delete" Event &
that's why a SQL UPDATE cannot lock the file.
I'm posting my 2 Subs here hoping someone can point out any mistakes /
workarounds.
Thx & Best Rgds,
Prakash.
----------------------------
Private Sub Save_Fields_In_Form_Header()
Dim StrSql As String
StrSql = "UPDATE JVTable SET JVTable.INV_DATE = " & _
IIf(IsNull(Me.Txt_Date),
"Null", DMY(Me.Txt_Date)) & ", " & _
"JVTable.RcdFm_PdTo = " & _
IIf(IsNull(Me.txt_RcdFm_PdTo), "Null", """" & Me.txt_RcdFm_PdTo &
"""") & ", " & _
"JVTable.Chq_No = " & _
IIf(IsNull(Me.txt_Chq_No),
"Null", """" & Me.txt_Chq_No & """") & ", " & _
"JVTable.Chq_Date = " & _
IIf(IsNull(Me.txt_Chq_Date), "Null", DMY(Me.txt_Chq_Date)) & ", " & _
"JVTable.Bank = " & _
IIf(IsNull(Me.txt_Bank),
"Null", """" & Me.txt_Bank & """") & ", " & _
"JVTable.Settled_Bill_Nos = " & _
IIf(IsNull(Me.txt_Settled_Bill_Nos), "Null", """" &
Me.txt_Settled_Bill_Nos & """")
CurrentDb.Execute StrSql, dbFailOnError
End Sub
..........................................
Private Sub Cmd_Delete_Click()
On Error GoTo Err_Cmd_Delete_Click
Dim stn As Byte, strControl As String
strControl = Screen.PreviousControl.Name
'MsgBox strControl
Application.Echo False
DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings True
Me.DrTotal = DSum("DEBIT", "JVTable") ' After deleting a Record
Totals shd be re-calculated
Me.CrTotal = DSum("CREDIT", "JVTable")
stn = Sub_Tran_No - 1 'Saving Current Record Pointer
Position
Call Cmd_ReNumber_Click 'Re-Number the sub_tran_no field if
any record is DELETED
Me.Recordset.FindFirst "[sub_tran_no]=" & stn
If Me.Recordset.NoMatch Then
Me.Recordset.MoveLast
End If
Me.Controls(strControl).SetFocus
Application.Echo True
Exit_Cmd_Delete_Click:
Exit Sub
Err_Cmd_Delete_Click:
If Err.Number = 3021 Then 'user tries to delete an EOF or BOF
record
'MsgBox "No More Records To Delete !", vbOKOnly +
vbInformation, "Message..."
Me.Controls(strControl).SetFocus
Application.Echo True
Else
MsgBox Err.Description & " " & Err.Number
End If
Resume Exit_Cmd_Delete_Click
End Sub
..........................................

I don't have any memo fields in my table. Hope you have any other
ideas ??

Best Rgds,
Prakash.


While stepping through the execution I realized what's causing the
error.
When I click the Delete button the foll statement :
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

causes the error:
The command or action 'SelectRecord' isn't available now. 2046

At this point my Access Application effectively freezes only allowing
me to shut down the App & Access.
I hope someone can point out where I'm going wrong.

Best Rgds,
Prakash.

Mar 4 '08 #5
On Mar 4, 11:48 am, prakashwadhw...@gmail.com wrote:
On Mar 4, 9:41 am, prakashwadhw...@gmail.com wrote:
On Mar 4, 3:27 am, "ARC" <PCES...@PCESoft.invalidwrote:
By the way, if you search through the table and focus in on the memo field,
look for #error in the table. This will indicate the locked/bad record.
<prakashwadhw...@gmail.comwrote in message
>news:8f**********************************@e25g200 0prg.googlegroups.com...
The Delete Event/Proc & "Save_Fields_In_Form_Header" Event/Proc in
my form were working perfectly.
However, after I added a call to the "Save_Fields_In_Form_Header"
Event/Proc in the "Current" Event of my form, and I now try to Delete
a record, I get ... Run-Time Error 3218 - Could not Update; Currently
Locked. My Access application then effectively freezes forcing me to
shut Access down & re-start.
The record DOES get deleted successfully.
What's happening is as follows:
1) I click the Delete command button on the form
2) The record gets deleted
3) The Current event gets fired & my Sub
"Save_Fields_In_Form_Header" gets called.
4) During the SQL update in the above Sub:
"Save_Fields_In_Form_Header", the above-mentioned error is triggered
on the foll statement: CurrentDb.Execute StrSql, dbFailOnError
I'm presuming here, the record is still locked by the "Delete" Event &
that's why a SQL UPDATE cannot lock the file.
I'm posting my 2 Subs here hoping someone can point out any mistakes /
workarounds.
Thx & Best Rgds,
Prakash.
----------------------------
Private Sub Save_Fields_In_Form_Header()
Dim StrSql As String
StrSql = "UPDATE JVTable SET JVTable.INV_DATE = " & _
IIf(IsNull(Me.Txt_Date),
"Null", DMY(Me.Txt_Date)) & ", " & _
"JVTable.RcdFm_PdTo = " & _
IIf(IsNull(Me.txt_RcdFm_PdTo), "Null", """" & Me.txt_RcdFm_PdTo &
"""") & ", " & _
"JVTable.Chq_No = " & _
IIf(IsNull(Me.txt_Chq_No),
"Null", """" & Me.txt_Chq_No & """") & ", " & _
"JVTable.Chq_Date = " & _
IIf(IsNull(Me.txt_Chq_Date), "Null", DMY(Me.txt_Chq_Date)) & ", " & _
"JVTable.Bank = " & _
IIf(IsNull(Me.txt_Bank),
"Null", """" & Me.txt_Bank & """") & ", " & _
"JVTable.Settled_Bill_Nos = " & _
IIf(IsNull(Me.txt_Settled_Bill_Nos), "Null", """" &
Me.txt_Settled_Bill_Nos & """")
CurrentDb.Execute StrSql, dbFailOnError
End Sub
..........................................
Private Sub Cmd_Delete_Click()
On Error GoTo Err_Cmd_Delete_Click
Dim stn As Byte, strControl As String
strControl = Screen.PreviousControl.Name
'MsgBox strControl
Application.Echo False
DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.SetWarnings True
Me.DrTotal = DSum("DEBIT", "JVTable") ' After deleting a Record
Totals shd be re-calculated
Me.CrTotal = DSum("CREDIT", "JVTable")
stn = Sub_Tran_No - 1 'Saving Current Record Pointer
Position
Call Cmd_ReNumber_Click 'Re-Number the sub_tran_no field if
any record is DELETED
Me.Recordset.FindFirst "[sub_tran_no]=" & stn
If Me.Recordset.NoMatch Then
Me.Recordset.MoveLast
End If
Me.Controls(strControl).SetFocus
Application.Echo True
Exit_Cmd_Delete_Click:
Exit Sub
Err_Cmd_Delete_Click:
If Err.Number = 3021 Then 'user tries to delete an EOF or BOF
record
'MsgBox "No More Records To Delete !", vbOKOnly +
vbInformation, "Message..."
Me.Controls(strControl).SetFocus
Application.Echo True
Else
MsgBox Err.Description & " " & Err.Number
End If
Resume Exit_Cmd_Delete_Click
End Sub
..........................................
I don't have any memo fields in my table. Hope you have any other
ideas ??
Best Rgds,
Prakash.

While stepping through the execution I realized what's causing the
error.
When I click the Delete button the foll statement :
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70

causes the error:
The command or action 'SelectRecord' isn't available now. 2046

At this point my Access Application effectively freezes only allowing
me to shut down the App & Access.

I hope someone can point out where I'm going wrong.

Best Rgds,
Prakash.


Please excuse my ignorance. The above-mentioned error i.e.
causes the error:
The command or action 'SelectRecord' isn't available now. 2046
is coming only because I'm stepping through the program & am in the
code window.

However ... my initial problem still remains ... BTW, dbFailOnError
gives an error number of 128. Does this mean anything to anyone ? Hope
someone can help me out.

Best Rgds,
Prakash.
Mar 4 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Pekka Niiranen | last post by:
Hi, I have used the following example from win32 extensions: -----SCRIPT STARTS---- import win32file import win32con import win32security import pywintypes
9
by: Kelly Vernon | last post by:
I have a standard ASP page that appends to an xml page. Currently if there is more than one person attempting to append to the same XML file at a time. One user will have the ability to append,...
1
by: rdavis7408 | last post by:
I have a database that has a form that opens a report using date parameters. I have been using it for six months and last week I began to get the following Error Message: "File sharing lock...
1
by: jv | last post by:
Hello, I'm using A2K and am trying to make sure that my program only locks one record at a time and I don't seem to have any luck getting that to happen. In the database options, I've selected...
6
by: martin | last post by:
Hi, I have noticed that every aspx page that I created (and ascx file) has an assosiated resource file aspx.resx. However what I would like to do is have a single global resource file for the...
14
by: Gary Nelson | last post by:
Anyone have any idea why this code does not work? FileOpen(1, "c:\JUNK\MYTEST.TXT", OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.Shared) Dim X As Integer For X = 1 To 26 FilePut(1, Chr(X +...
8
by: Komandur Kannan | last post by:
We have a smart device application running on handhelds(Symbol MC9000G). The backend is Oracle and a middle tier web services development done in Vb.net. We use pessimistic Locking due to...
22
by: RayPower | last post by:
I'm having problem with using DAO recordset to append record into a table and subsequent code to update other tables in a transaction. The MDB is Access 2000 with the latest service pack of JET 4....
19
by: emanning | last post by:
Using Access 2003 and using a form that's mostly bound. I need a way to tell if user-1 is on the record when user-2 tries to open the same record, w/o waiting for the user-1 to save the record...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.