Is there a way to create a subform in VB similar to those used in Access. I would like to convert some existing Access Applications to VB. Any help would be greatly appreciated.
Tom
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » VB Subform like Access (VB6 SP5)
Not really, although you can use the DataRepeater control to give you a rough equivalent of a continuous form. Nested subforms are out of the question.
What exactly are you trying to do? It might be possible to find a custom control that would give you something like what you’re looking for.
What I’m attempting to recreate is an order form. The main form is the order details and the subform is the order items. Currently in Access I have a combobox on the subform that allows the user to select a product code. In the Before_Update event I move the information in the other columns to other fields on the item record such as description and cost. It works wonderfully in Access, but I’m trying to create an executable in VB. This is for my own benefit/education on learning VB.
I’ll look more closely at the datarepeater and see if that is going to do the job. Any other advice is always welcome.
Thank you,
Tom
You can create ‘Master’ and ‘Detail’ forms using the Microsoft ‘Data Grid’ control. This would allow you to display a list of companies and all the contacts at each company, similar to Access.
Use the ‘Application Wizard’ to create a new project & ‘Next’ through all the prompts until you get to ‘Data Access Forms’. Select ‘Create new Form’ and provide the database format / database name. Eventually you are taken to a form where you have to specify the form layout (Master/Detail, Grid, Flexgrid etc). You will then have to provide the recordsource for the grid before it is created.
However, this is just creating a grid with SQL – there is no sub-form object like in Access. But at least this allows you to replicate views that users are familiar with in Access.
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.