Skip to Content
0
Former Member
Jan 15, 2008 at 09:53 PM

Form/Event Error

15 Views

I have the folllowing code in the item event:

If pVal.FormTypeEx = "mcgscomm" Then

If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.BeforeAction = False Then

If pVal.ItemUID = "btnOk" Then

CleanForm(oForm)

End If

End If

End If

The Cleanform routines is as follows:

Private Sub CleanForm(ByRef oForm As SAPbouiCOM.Form)

Dim oMatrix As SAPbouiCOM.Matrix

Dim oStaticText As SAPbouiCOM.StaticText

Dim oEditText As SAPbouiCOM.EditText

oMatrix = oForm.Items.Item("M_Matrix").Specific

oMatrix.Clear()

oStaticText = oForm.Items.Item("mcg_CName").Specific

oStaticText.Caption = ""

oEditText = oForm.Items.Item("mcg_Date").Specific

oEditText.Value = ""

oEditText = oForm.Items.Item("mcg_Inv").Specific

oEditText.Value = ""

oForm.DataSources.UserDataSources.Item("StatusDS").ValueEx = "Selected"

oForm.DataSources.UserDataSources.Item("SlspDS").ValueEx = ""

oForm.DataSources.UserDataSources.Item("CustDS").ValueEx = ""

oForm.DataSources.UserDataSources.Item("SalesDS").ValueEx = 0

oForm.DataSources.UserDataSources.Item("CostDS").ValueEx = 0

oForm.DataSources.UserDataSources.Item("CommDS").ValueEx = 0

oForm.DataSources.UserDataSources.Item("CPerDS").ValueEx = 0

oEditText.Active = True

End Sub

The issue is that the cleanform executes without problem but when the item event completes the application crashes (I'm not getting any messages from the debugger so it's making hard to determine the issue). Any suggestions?

Regards,

WB