Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Forms

Status
Not open for further replies.

richself

Technical User
Jun 27, 2005
37
US
I've created an Form that connects, reads and writes to a database. I would like to add an additional form for the user to enter additional information if needed. I'm unsure of where to start. My thought would be to create a new class and go from there. I'm not sure what to Inherit, I do not need the form to look like the other one but I would like to read and write to the same database, just different table within. Do I have to create new connections, adapters and so on or can I pass the already new ones to the new form?

Any help would be appreciated.

 
So you dont want an EXACT copy of the first form? You want another form with different fields linked to the same record on the first form connecting to the same database? Is that right?
 
Same database, different table within that. Currently on the first form, I'm accessing 2 different tables with the same database but different datasets.
 
I've gotten this far. I've created a new form, I then call the new form with the code below from the original form.

Dim reportDialogResult As DialogResult

If excessiveCheckBox.Checked Then
reportDialogResult = MessageBox.Show("Would ....quest", _
MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If reportDialogResult = DialogResult.Yes Then
'Call Spoilage form
Dim mySpoilage As New Spoilage
mySpoilage.Show()
Else
Exit Sub
End If
End If

The new form is Spoilage.vb , it comes up fine. I guess at this point I would just create a new command, connection, adapter and dataset on this form? I was hoping I could use all the stuff from the main form and just create an additional dataset for the Spoilage form.
I have a feeling I'm making more work for myself.
 
Yes you will have to create a new data adapter and connection object. However, i believe you will be able to reuse the dataset.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top