Hi Everyone,
I have an application I'm working on and have come across a problem for which I can't find an answer.
I have created a subroutine that dynamically creates a form from a SQL Server table.
In the Save button on the BindingNavigator I have the following code:
Public Sub ImageButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs)
For Each frm In My.Application.OpenForms
MsgBox("Form.Tag: " & frm.Tag & " Form Name:" & frm.Name)
Next
End Sub
The code is activated though the AddHandler method. All this code does is show all open forms in my application.
When you press the Save button on ANY of my dynamically generated forms you will get a message box showing the Form.Tag and Form.Name properties in the order they were generated starting with my LogIn form.
The LogIn form was created using the GUI designer and the Name property was set to frmLogIn. According to what I found on the Internet you cannot use the Name property on dymanically created forms; you must use the Tag property. So I tagged the Customers Form, Categories Form, and the Employees Form using their table names.
Which brings me to the problem I'm having: How can I click on the Save button on the BindingNavigator control on the Employee dynamically generated form and it show me only the message box containing the Form.Tag and Form.Name properties on the Employees Dynamic Form?
I took screen captures of the generated forms and the Message Boxes returned from the ImageButton_Click event code, but currently there is no way to incorporate them into this question.
I thank you for any assistance you can offer,
MRM256