[Solved] Run 2 macros from one event?
Posted: Wed Jul 11, 2018 12:15 pm
Is it possible to run 2 macros from one event?
I have the below macro running from item status changed in my txtCustomer listbox. This updates my txtSimilarPart listbox.
I want a second macro to run from the same txtCustomer listbox for the same item status changed event which updates my txtReplaces listbox.
My Macros is
Sub CustChange
oForm1 = ThisComponent.Drawpage.Forms.getByName("MainForm") 'Get Form
oField = oForm1.getByName("txtCustomer")
sSelectedValue = oField.SelectedValue
sSql = "SELECT ""PartNumber"" FROM ""PartNumber"""&_
" WHERE ""CustomerID"" = '" & sSelectedValue & "' ORDER BY ""PartNumber"" ASC"
oField = oForm1.getByName("txtSimilarPart")
oField.listsource = array(sSql)
oField.refresh()
End Sub
For the second Macro I would just change to ("txtReplaces")
So can i create a macro for example Sub 2Macros that runs the two macros i need to run or do I build the two macros into one?
If i make the two macros into one is it as simple as just pasting in the second macro before the end of the End Sub?
many thanks
I have the below macro running from item status changed in my txtCustomer listbox. This updates my txtSimilarPart listbox.
I want a second macro to run from the same txtCustomer listbox for the same item status changed event which updates my txtReplaces listbox.
My Macros is
Sub CustChange
oForm1 = ThisComponent.Drawpage.Forms.getByName("MainForm") 'Get Form
oField = oForm1.getByName("txtCustomer")
sSelectedValue = oField.SelectedValue
sSql = "SELECT ""PartNumber"" FROM ""PartNumber"""&_
" WHERE ""CustomerID"" = '" & sSelectedValue & "' ORDER BY ""PartNumber"" ASC"
oField = oForm1.getByName("txtSimilarPart")
oField.listsource = array(sSql)
oField.refresh()
End Sub
For the second Macro I would just change to ("txtReplaces")
So can i create a macro for example Sub 2Macros that runs the two macros i need to run or do I build the two macros into one?
If i make the two macros into one is it as simple as just pasting in the second macro before the end of the End Sub?
many thanks