Dynamic Fields in Access Form

VBABasix

Board Regular
Joined
Aug 15, 2005
Messages
52
I have a table that has a row for each order number. I would like to display in a form the customer and all orders that have been placed and the date of the order. How do I create the fields in the form dynamically?


Thanks
 
There is one main table that contains the a line item for each piece of equipment that the cusotmer has ordered. So if a customer has 3 pieces of equipment there would be 3 lines.
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
So what's actually in this main table?

Is it the only table?
 
Upvote 0
The table identified is the primary table, meaning that it includes all the customer information such as account number, equipment ordered, date ordered, date shipped, sales information, etc. This is then tied to the equipment value table, and the state table and the correspondance type table and the sales assignment table.
I then have seperate tables to identify the value of the equipment, the user that updates the table, and another table that identifies correspondance types, a table for the states, and then 2 tables used to itentify sales assignment.

Thanks
 
Upvote 0
I think you really need to consider restructuring your data.

I'm still a little unclear of your setup but it sounds to me as though you are repeating a lot of (customer?) data in your 'main' table.
 
Upvote 0
Thanks for your help. I will go back and start over the main problem I am facing is that the main table data is coming from an external source.

Thanks again!
 
Upvote 0
I broke the main table down into 2 tables as follows:

Cust_mast table (Contains cust number address etc)
Equip Table Contains a primary id, cust number from the cust_mast table and the equipment information.

This leads me back to the orignal problem. In my form I have a main form for the customer info and a subform for the equipment info. In the report I am trying to output the cust info with all equipment associated. If I add the ID from the sub form to the main form in order to pass it to the report, it only picks up the first ID in the subform and not the multiple ID.

Thanks

:oops:
 
Upvote 0
About the tables:

As a minimum, you will need --

Customers
CustomerID
and all cusotmer-related fields

Items
ItemID
and all item-related fields

Orders
OrderID
CustomerID
ItemID
and date, etc.

Then, relate Customers to Orders and Items to Orders.

What you have described is a many-to-many situation (one customer could place many orders, and one item could appera on many orders). The above is the standard way to deal with many-to-many: you MUST have a linking table, otherwise the setup just won't work.
If you have the Northwind sample database on your system, go take a look. Also, go to the Microsoft Knowledge Base and run a search on Understanding Relational Design. It shows how to set up the table structure, based on Northwind.

Denis
 
Upvote 0
Thaks for all the help. I have gone back and am re-designing the database. THe main issues that I am facing is that the data is coming from an external report and so I have to go through several stept to break the data out into multiple tables.

Thanks again and Happy Holidays
 
Upvote 0
You should be able to automate splitting the table up with code.

It might be hard to implement at first but once done will save you a lot of work.

Post back if you need more information.
 
Upvote 0

Forum statistics

Threads
1,215,731
Messages
6,126,537
Members
449,316
Latest member
sravya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top