dataset access from two forms...

herbally

Member
Joined
May 12, 2008
Messages
5
Programming Experience
1-3
I'm a novice VB.NET developer at best. Here's my issue: I've written a membership app that reads magnetically encoded info from ID cards and automatically inserts them into my access database. I need the ability to manually insert a member from form2 (my data entry form) into the dataset on my main form.

I'm trying to figure out the best possible solution to this which I'm assuming shouldn't be that difficult for someone with more experience. Can someone please give me a nudge in the right direction? It'd be much appreciated! Thanks!
 
Just have Form2 expose the data entered by the user via one or more properties. Form1 can then simply get that data and add it to the collection. Form2 doesn't even have to know that Form1 exists, never mind what data it has. The pattern for this sort of thing looks like this:
VB.NET:
Using dialogue As New SomeForm
    'Pass initial data into dialogue here.

    If dialogue.ShowDialog() = Windows.Forms.DialogResult.OK Then
        'Get final data from dialogue here.

        'Use data here.
    End If
End Using
 
Back
Top