We help IT Professionals succeed at work.

Public Save Button

MohamedAiz
MohamedAiz asked
on
Medium Priority
249 Views
Last Modified: 2010-04-17
I have one Command button (Save) on my MD Form, and there are lots of Child forms, I would like to use that button for saving data to each form How can I do that in Visual Basic.Net
Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2006
Commented:
Its been a while since I last looked at vb.net so will describe it

is it possible to create a public function in each of the subforms?
so when save button on main form hit, you call each of the subforms public function

this public function will then perform the save operation specific to that child form

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
omegaomegaDeveloper
CERTIFIED EXPERT

Commented:
Hello, MohamedAiz,

I have used essentially the same approach that rockiroads is recommending.  In my case I was able to have all of my Child forms inherit from the same base form class.  If you can do this it makes it very easy, because then you can simply add the public function he speaks of to the base class.

Cheers,
Randy
omegaomegaDeveloper
CERTIFIED EXPERT

Commented:
Hello, Venabili,

I think that rockiroads response provides a good answer to the OP.

Cheers,
Randy
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.