Link to home
Start Free TrialLog in
Avatar of rfgraham
rfgrahamFlag for United States of America

asked on

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?
Avatar of Binuth
Binuth
Flag of India image

getting any error ? please provide the code
Avatar of rfgraham

ASKER

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)"
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
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.
call...
Save_Click(nothing,nothing)
ASKER CERTIFIED SOLUTION
Avatar of Wayne Taylor (webtubbs)
Wayne Taylor (webtubbs)
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial