ERROR: "...Can't find the field 'i' referred to in your expression

G

Glint

Hi All,
I have this code for a delete button on my form:

Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click

If vbYes = MsgBox("You are about to delete 1 record." & vbCrLf & vbCrLf
& _
"If you click YES, you won't be able to undo this Delete operation." &
vbCrLf & vbCrLf & _
"Are you sure you want to delete this record?", vbYesNo +
vbInformation, "ECKANKAR AREA ADMIN") Then
DoCmd.SetWarnings False
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
Else
Exit Sub
DoCmd.SetWarnings True
End If
DoCmd.SetWarnings True

Exit_cmdDelete_Click:
Exit Sub

Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click

End Sub

I also have:

cmdDelete.Visible=False

in the On Current code of the form, because I want the button displayed only
on specific conditions.

These codes work fine. But I found that after I packaged and installed the
mde version of the application with the Office Developer 2002 (Windows XP II)
on my machine in the office, the following error message would come up
whenever I delete a record with the button:

"Access can't find the field 'l' referred to in your expression."

Strangely, this error message does not show up in the mde or the mdb
version, nor on the PC at the ECK Center (also Windows XP) where I also
installed the package. It only shows up on the machine which I used to
develop and package the application.

Do you have an idea what is responsible for this error message?
 
G

Graham Mandeno

Hi Glint

I think what you are seeing as an "i" is actually a vertical bar, which is
used as a parameter substitution character by the error subsystem.

I suggest you temporarily comment out the "On Error Goto" line and you might
get a more meaningful message.

Also, DoCmd.DoMenuItem has been obsolete since Access 97. I suggest you
replace those two lines with:

DoCmd.RunCommand acCmdDeleteRecord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top