Your efforts are appreciated
However, this will not work for me because I am working with Instance Form so the function must be called from the same form
Ok, I originally want to call a function from the same subform
But I do all the attempts
The important thing is, I do not want to call the function from the main module
I tried to put the function on the main Form and call it from the subform
And I tried to put it in the same subform and call it from the subform
All this did not work
Public Function UnitPrice()
Msgbox "Hello"
End Function
Public Function ShortCutMenuM()
Set Button = .Controls.Add(msoControlButton)
With Button
.Caption = "PriceName"
.OnAction = "=UnitPrice()"
End With
End Function
How Can I Call Function On The Same Form
.OnAction = "UnitePrice"
.OnAction = "=UnitePrice"
.OnAction = "=UnitePrice()"
.OnAction = "MainForm.UnitePrice()"
All of these did not work
It only works from the main module page
The solution has been found
[In the form that will be storing the variable (unbound)]
Private WithEvents dlg As Form_frmCustomDistList
Private Sub dlg_Finished(vReturnValue As Variant)
BLAH BLAH..
End Sub
Private Sub cmdDistributionList_Click()
Set dlg = New Form_frmCustomDistList...
Thank you, my dear brother
But believe me, I'm doing something cool, but it's already a little complicated
But thanks to your information, I have now reached my goal
But one thing remained, and that was how I call instance form from another form
Ok the problem was solved
I used the query and were filtering according to the frm.Hwnd
But the problem remained, how to access this form
I have an account selection form
When selecting an account, it inserts it in the form, but in this case it does not find the form