Link to home
Start Free TrialLog in
Avatar of anthonytr
anthonytrFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Create a subform in


I'm trying to convert my current Ms Access database into using Visual Studio 2013.  I'm getting stuck on a number of things, one no more so than trying to setup a 'subform' on a form.

Currently my Access form has its main datasource set from tblBatches and there is a subform at the bottom set to tblReference_data.

For every entry in the tblBatches table there are a number of references in the tblReference_data table.  (1 to many)

How would  replicate this is (Visual Studio 2013)?  They are linked via Batch Reference from both forms

Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anthonytr


Avatar of SStory
I agree. There is really no such concept as a subform like in Access. A form in is merely a visual U/I window of the application. In terms of your 1 to many relationship issues that an Access subform solves, as mentioned above you can have your normal fields on top and a DataGridView for related data.  You could also represent this with a ListViewControl, or even a TreeView control or TreeView and Listview controls in combo depending upon your data and how you want the app to work. Basically you write the logic so that when the user clicks on whatever represents the next record, maybe a node in a tree or main ListView, the other part is populated (by your code). Of course there are ways to bind data to avoid some of that work, but it isn't really that difficult.

Google: " datagridview Examples" for tons of samples.