Forum Discussion
Jim Conaway
Jul 11, 2018Copper Contributor
VBA userform
Hello,
I am completely new to VBA and recently struggled through designing a userform with VBA (it was a tedious process). My problem, the first 4 columns in the database need to be the same when adding data to a subsequent column. For example, in my proposal input form the first four fields will stay the same while the millwork description may have several entries for the same project number, etc. I am just asking for some direction here as I have no idea where to start to solve this issue. Many thanks in advance for any suggestions. Cheers.
3 Replies
Sort By
- JKPieterseSilver Contributor
So what you have here is basically a project with multiple millworks. That would normally mean you would need two tables; one with the projects and one with the millworks. The project table would need a unique identifier for each row of data (called "Record" in database terms) and the millworks table needs a column (called "Field" in database terms) with the associated project identifier from the projects table. Long story short: DON'T TRY creating a database in Excel. Save yourself big headaches by using a proper database application. MS Access is a good way to start.
- Jim ConawayCopper Contributor
Jan, thank you for your reply. Interestingly, I am currently taking a course on Access and started thinking the same thing, but I am not sure how to get the project relate to a number of millwork descriptions. I am learning. Thanks again.
- JKPieterseSilver ContributorAFter defining both tables in MSAccess, click on Database tools and click the relationships button. Drag the ID field from the projects table to the related project ID field in the millworks table to create a (one to many) relationship.