• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2100
  • Last Modified:

Calling a Private Sub from another Private Sub

I need to call a Private Sub called Save_Click from another Private Sub called New_Click. I can call a Private Sub I create but when I try and call one from a Private Sub generated from a Button it doesn't work. How would I code this?
0
rfgraham
Asked:
rfgraham
1 Solution
 
BinuthCommented:
getting any error ? please provide the code
0
 
rfgrahamAuthor Commented:
I am trying to call the sub using this: Save_Click()
and I'm getting this error - "Argument not specified for parameter of 'e' of 'Private Sub Save_Click(send As Object, e As System.EventArgs)"
0
 
appariCommented:
are the two subs in the same class/module? if they are in two different classes you cannot call as their scope is private. have to change them to public scope.
please post existing code and the error message
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
appariCommented:
if you are trying to call "Private Sub Save_Click(send As Object, e As System.EventArgs)"
you need to pass the parameters sender and e too.
0
 
BinuthCommented:
call...
Save_Click(nothing,nothing)
0
 
Wayne Taylor (webtubbs)Commented:
If you trying to run the procedure which handles the Click event of a Button, use the PerformClick method of the button.

http://msdn.microsoft.com/en-us/library/system.windows.forms.button.performclick.aspx

Wayne
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now