I've gotten a new error in Access 2010 runtime. I'm trying to convert from Access 2003 to 2010. For Access 2003 everyone has a development copy. In the move to 2010 they decided to save some money and only provide the runtime for most users. I'm keeping the database as an MDB. Perhaps I would do better to give that up?
The error I'm getting is:
"Microsoft Access has stopped working
Windows can try to recover your information and restart the program.
(button) Restart the program"
The error occurs when I try to open a form via VBA coding in a different form.
A button is clicked executing the following code:
MOCID is an integer value that represent the primary key of the MOC form.
The MOC form has a form and subform. I've traced it though the event procedures. I get the error after the open and current events. In the open event I have the coding:
My work around is to use the FindFirst method instead of a filter. That seems to work without an error. It is the following:
The FormSecurity function sets the passed form object (field) locked status depending on the user and the content of the object tag property. That is partly how I implement security. However, I think that is not the issue. It is the difference between using a filter and using FindFirst.
This original coding works just fine in 2003 developement version (did not test 2003 runtime). However, fails in 2010 without the work around.
I know there is much going on VBA wise, but I was wondering if anyone may have an idea of what is going on the runtime?
The error I'm getting is:
"Microsoft Access has stopped working
Windows can try to recover your information and restart the program.
(button) Restart the program"
The error occurs when I try to open a form via VBA coding in a different form.
A button is clicked executing the following code:
Code:
Private Sub cmdJumptoMOC_Click()
' Jump to the MOC form
' If the form is already open then close it first
If isFormOpen("MOC") Then DoCmd.Close acForm, "MOC"
' Bring up MOC form
DoCmd.OpenForm "MOC", , , , , , "MOCID=" & MOCAllDocsSF!MOCID
End Sub
The MOC form has a form and subform. I've traced it though the event procedures. I get the error after the open and current events. In the open event I have the coding:
Code:
Private Sub Form_Open(Cancel As Integer)
' If open with an argument then jump to the record. However, turn off add rights
If Parent.OpenArgs <> "" Then
Filter = Parent.OpenArgs
FilterOn = True
AllowAdditions = False
End If
' Set security
FormSecurity Me
End Sub
Code:
Private Sub Form_Open(Cancel As Integer)
' If open with an argument then jump to the record. However, turn off add rights
If Parent.OpenArgs <> "" Then
Me.Recordset.FindFirst Parent.OpenArgs
' Filter = Parent.OpenArgs
' FilterOn = True
' AllowAdditions = False
End If
' Set security
FormSecurity Me
End Sub
This original coding works just fine in 2003 developement version (did not test 2003 runtime). However, fails in 2010 without the work around.
I know there is much going on VBA wise, but I was wondering if anyone may have an idea of what is going on the runtime?
Last edited: