theberzerker69
08-05-2004, 09:00 AM
I have a project with multiple forms. Most of them are displayed from the main form, Form1.
Form2
l
Form5--Form1--Form3
l
Form4
Form1 displays data from an access table. The other forms are used to add/edit data in the datatable. When the other forms are unloaded or closed, I need the datatable on form1 to be refreshed. This is done on Form1 with a sub "QuerySub()." Right now the QuerySub is put in a random control behind a picture box with the code:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
QuerySub()
End Sub
So right now the Button is clicked from the other forms like so:
Form1.Button1.PerformClick()
This works, but it isn't clean. Is there a way to execute a Sub on Form1 from Forms 2-5?
Thanks in Advance
Tom
Form2
l
Form5--Form1--Form3
l
Form4
Form1 displays data from an access table. The other forms are used to add/edit data in the datatable. When the other forms are unloaded or closed, I need the datatable on form1 to be refreshed. This is done on Form1 with a sub "QuerySub()." Right now the QuerySub is put in a random control behind a picture box with the code:
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
QuerySub()
End Sub
So right now the Button is clicked from the other forms like so:
Form1.Button1.PerformClick()
This works, but it isn't clean. Is there a way to execute a Sub on Form1 from Forms 2-5?
Thanks in Advance
Tom