I have an add-in that brings up a userform in RMS - the userform prompts the user to select some options, and then based on what they selected for options, it populates a combobox with certain itemlookupcodes. this part works fine so far. the combobox populates with the correct data just as it's supposed to. now what i need to do is take whatever itemlookup code the user has selected in the combobox, and add that as a new entry to the transaction when they press ok on the userform. this is what i have right now for my command button click event:
Private Sub cmdOK_Click() If cboPlans.Column(0) = "" Then MsgBox "Input Required!" cboPlans.SetFocus Else glbPlanID = cboPlans.Column(0) glbItemID = cboPlans.Column(1) frmPlans.Hide End If End Sub
glbPlanID is my ItemLookupCode and glbItemID is my Item ID. and in my class module contains this piece of code:
If glbDeptID = 8 Or glbDeptID = 19 Then glbPlanID = "" frmPlans.Show 1 If glbPlanID "" Then PerformAddItem glbItemID, glbPlanID, 1, 0, 0, 0, 0 End If End If
i must not be going about this the right way because my item is not getting added to the transaction. how can i trigger the performadditem fireevent from within my code when I close the userform, and have it add an item using the glbPlanID and glbItemID variables I have declared in the code?
thanks, Kevin