craigachan
Registered User.
- Local time
- Today, 10:36
- Joined
- Nov 9, 2007
- Messages
- 285
I've reposted this problem in this forum in hopes to get more feedback.
I have this form that works fine in Access 2007 full version. The form is quite complex but it works. The problem is that when I run it in run-time, I get kicked out. I get "Execution of this application has stopped due to run-time error".
Background:
I have a form with many fields called ms1, ms2, ....ms32. On doubleclk ms1, it changes its value by cycling through 3 values "H-Pk", "GBR", and Null. I do this rather than have cbo or list boxes.
Function msCode handles this value change in each of the ms* doubleclicks.
I've tried the suggestions in this forum to find out what the error is,such as cntr-break before the runtime close, but I get closed out and don't see any error number or discription. I've also tried running the runtime on different PCs but get the same each time.
For this example:
-ParamMs = "ms" This is a constant
-Param = "1" - Changes depending on the field
-Field "aa" is used to move the focus off of "ms1" in order to change the value in ms1.
Here is the event for ms1
Here is the Function msCode
In Access 2007 full version, I get no errors. I'm not sure why this does not work in runtime. I'm open to any suggestions. Thank you.
I have this form that works fine in Access 2007 full version. The form is quite complex but it works. The problem is that when I run it in run-time, I get kicked out. I get "Execution of this application has stopped due to run-time error".
Background:
I have a form with many fields called ms1, ms2, ....ms32. On doubleclk ms1, it changes its value by cycling through 3 values "H-Pk", "GBR", and Null. I do this rather than have cbo or list boxes.
Function msCode handles this value change in each of the ms* doubleclicks.
I've tried the suggestions in this forum to find out what the error is,such as cntr-break before the runtime close, but I get closed out and don't see any error number or discription. I've also tried running the runtime on different PCs but get the same each time.
For this example:
-ParamMs = "ms" This is a constant
-Param = "1" - Changes depending on the field
-Field "aa" is used to move the focus off of "ms1" in order to change the value in ms1.
Here is the event for ms1
Code:
Private Sub ms1_DblClick(Cancel As Integer)
On Error GoTo ms1_Err
Param = "1"
Call msCode
ms1_Exit:
Exit Sub
ms1_Err:
MsgBox Err.Number & " - " & Err.Description
Resume ms1_Exit
End Sub
Here is the Function msCode
Code:
'-----------------------------------------------
' Cycles thru HPack, GBR, Null
'
'-----------------------------------------------
Function msCode()
On Error GoTo msCode_err
If IsNull(Me(Me.ParamMs & [Param])) Then
DoCmd.GoToControl "aa"
Me(Me.ParamMs & [Param]) = "H-Pk"
End
End If
If Me(Me.ParamMs & [Param]) = "H-Pk" Then
DoCmd.GoToControl "aa"
Me(Me.ParamMs & [Param]) = "GBR"
End
End If
If Me(Me.ParamMs & [Param]) = "GBR" Then
DoCmd.GoToControl "aa"
Me(Me.ParamMs & [Param]) = Null
End
End If
If Me(Me.ParamMs & [Param]) = "" Then
DoCmd.GoToControl "aa"
Me(Me.ParamMs & [Param]) = Null
End
End If
msCode_Exit:
Exit Function
msCode_Err:
MsgBox ("error: " & Err.Number & "Desc: " & Err.discription)
Resume msCode_Exit
End Function
In Access 2007 full version, I get no errors. I'm not sure why this does not work in runtime. I'm open to any suggestions. Thank you.