fault message on command button

G

gr

Hi, One user is getting the following message when
clicking on a command button of a form. the message
appears randomly but often and the application is
finished.

<< The instruction at "0x650a40ed" reference memory
at "0x00666699". The memory could not be "read".>>

The command button code looks like this:

Private Sub cmdGoDateName_Click()
On Error GoTo ErrInSub
If (IsNull(Me!txtName)) Then
MsgBox "Please choose a Name from the list!",
vbCritical, "Warning"
Exit Sub
End If
Dim strName As String
strName = Me!txtName
DoCmd.OpenForm "frmChooseArea", acNormal
Forms!frmChooseArea!txtboxName = strName
Forms!frmChooseArea!txtboxName.Locked = True
DoCmd.Close acForm, "frmDateName"
SalirSub:
Exit Sub
ErrInSub:
MsgBox "Error " & Err.Number & ": " &
Err.Description
Resume SalirSub
End Sub

Any thoughts?
 
E

Edward Lollar

Hi, I've had this problem numerous times, and it usually happens when I have
a program open--especially if I'm modifying a report or form--when I lose
connection to the server. For some reason, it appears that something gets
out of phase between the registry and the code. What I've learned will fix
this is create a NEW form. Open the old form in design mode ONLY. Select
all of the objects and past them into the new form. SAVE the form as Form1
or something temporary. THEN, try to get to the code of the form. If you
get a memory reference error at that point, you won't lose your new form.
Whether you get to the code of your existing form or if you have to go to a
backup (I usually go to a backup copy), copy all of the code and past it
into the new form. Rename the old form to [FormName]OLD and rename the new
form the original name. Recompile. It should work. NOTE: I have never
had any success trying to recover from backup or by trying to fix the
existing form that's corrupted. The ONLY way I've ever been able to fix
this is the above method. I'm always open to new ideas if someone else has
any, but for now, try this. If not, post again, and I'll try to walk you
through another way.

Hope this helps!

Edward


Hi, One user is getting the following message when
clicking on a command button of a form. the message
appears randomly but often and the application is
finished.

<< The instruction at "0x650a40ed" reference memory
at "0x00666699". The memory could not be "read".>>

The command button code looks like this:

Private Sub cmdGoDateName_Click()
On Error GoTo ErrInSub
If (IsNull(Me!txtName)) Then
MsgBox "Please choose a Name from the list!",
vbCritical, "Warning"
Exit Sub
End If
Dim strName As String
strName = Me!txtName
DoCmd.OpenForm "frmChooseArea", acNormal
Forms!frmChooseArea!txtboxName = strName
Forms!frmChooseArea!txtboxName.Locked = True
DoCmd.Close acForm, "frmDateName"
SalirSub:
Exit Sub
ErrInSub:
MsgBox "Error " & Err.Number & ": " &
Err.Description
Resume SalirSub
End Sub

Any thoughts?
 

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

Top