Question refreshing the parent's form data from another form

vb_newb

Member
Joined
Jan 31, 2013
Messages
7
Programming Experience
Beginner
good day.. im a newb and i got a question regarding with my project..

im trying to update the data from my first form from the second form..

my problem is that twant to update the data from the first form after i save new data from the second form..

im using showdialog.. pls anyone help me with this .. tyia
 
good day.. im a newb and i got a question regarding with my project..

im trying to update the data from my first form from the second form..

my problem is that twant to update the data from the first form after i save new data from the second form..

im using showdialog.. pls anyone help me with this .. tyia

Hey, have you tried using my.settings?

You are going to want to utilize creating strings and integers in the my.settings page first. Then you can simply do things like
VB.NET:
my.settings.examplestring = "Hello World"
my.settings.save

Then reload the settings in your second form
VB.NET:
my.settings.load

Also, you may just want to work with control boxes and keeping your data localized in one form.

May I ask what is it that you are working on so I may provide you with a better answer.
 
If you have a Refresh() method on your parent form, which you are trying to call then you can do this

Dim frmParent as Form1 = Ctype(application.OpenForms("instanceNameOfForm1"), Form1)
frmParent.Refresh()


If you mean you have data on the child form which you want to be made available to the parent form then do this


Dim frmForm2 as new Form2
frmForm2.ShowDialogue()

Dim myvar as string = FrmForm2.SomePublicProperty()


Immediately after the Form2 has been closed, you can still access its public properties as shown above.
 
Last edited:
i got 2 forms (A and B) both contains same data from access database

[FONT=Verdana]Dim frmForm2 as new Form2[FONT=arial]
im using "showdialog" to display form B..in form B i want to  edit/save/delete data..

after i close form B the data  that i inputted should  be added or appear in form A..

the problem is i dont know the codes ..


i tried this but it doest works.. sorry coz im just new with this ..

[/FONT]
[/COLOR][COLOR=#333333][FONT=Consolas]Dim frmForm2 as new Form2[/FONT][/COLOR]
[COLOR=#333333][FONT=Consolas]frmForm2.ShowDialogue()[/FONT][/COLOR]
[COLOR=#333333][FONT=Consolas] [/FONT][/COLOR]
[COLOR=#333333][FONT=Consolas]Dim myvar as string = FrmForm2.SomePublicProperty()[/FONT][/COLOR]
 
just fresh your data after the dialogue box (form b) closes.
Dim frmForm2 as new Form2
frmForm2.ShowDialogue()
 
RefreshData()

 
just fresh your data after the dialogue box (form b) closes.
Dim frmForm2 as new Form2
frmForm2.ShowDialogue()
 
RefreshData()



what is the coding for vb.net 2008??
 
@Lotok@ Hi James, nice replies and a great blog web site which I found very helpful. Thank you very much for your high standard of code examples and for helping the community.

Best regards,
Rob
 
Back
Top