Hi Evrey body
this sort of general question.
I have subrotine, which is working, I want to call it to be run by another event let's say closing of a Form.
how can I do it?
and what would be the code if I wanted to press a Button by Code?
Hi roppetech
Thanks a lot.
That worked.
One other note on this issue.
Could you do the same by Making a Function of my Sub.
Lets call my Sub:
Private Sub AcceptQoute_Click()
I'm not sure what you mean, but functions are pretty much the same thing.
You can do one of these:
Code:
Public Function AcceptQuote(strAmount as String, strName as String)
msgbox "Thank you, " & strName & " for accepting this quote of " & strAmount
...
End Function
Followed up by a few of these:
Code:
Private Sub AcceptQoute_Click()
AcceptQuote(txtPrice, txtName)
End sub
Private Sub OtherPlaceYouWantToAcceptQuote_Click()
AcceptQuote(txtDiscountPrice, "FooBar")
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.