By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,314 Members | 1,539 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,314 IT Pros & Developers. It's quick & easy.

Populating all fields in a table with the use of a subform

P: 39
I use Windows XP and Access 2003
I have a table called tblProcessLine
it contains the following fields:

Autonumber1 PK
Date
WorkOrder
Qty
LoadNumber
Timein
TimeOut
Shift
Badge
Rework
Billets
Pinwheel
Trimtabs

I have a main form that fills in the following fields:
Date
LoadNumber
TimeIN
TimeOut
Shift
Rework (yes/no)
Badge

I have a subform that fills in:

WorkOrder
Qty

I need the WorkOrder row to also contain all the information in the main form as well as the subform. This is not happening. I get blank fields in the rows where the WorkOrder is populated. I was wondering if need VBA code to read and populate those fields.

Any help would be great.
Oct 6 '08 #1
Share this Question
Share on Google+
7 Replies


FishVal
Expert 2.5K+
P: 2,653
Hello, Arli.

I guess both main form and subform are bound to your table.
If so, then all you need is to put the table PK into Master and Child properties of the subform control.

Regards,
Fish
Oct 6 '08 #2

nico5038
Expert 2.5K+
P: 3,072
Hmm, I would start with normalizing your table from tblProcessLine into tblProcessHeader and tblProcessLine.
Now the "Header" data doesn't have to be replicated and when using the "Header" as the main form, than Access will propose to link the OrderID of the Header as the linkage field to a sub form based on tblProcessLine.

Best to check out the NorthWind.mdb sample database from Microsoft to see how the Order and Orderdetail is created and maintained.

Nic;o)
Oct 6 '08 #3

P: 39
Hello, Arli.

I guess both main form and subform are bound to your table.
If so, then all you need is to put the table PK into Master and Child properties of the subform control.

Regards,
Fish

I did this and still it does not work correctly. I still get the information from the main form on a single line, with the information from the WorkOrder subform on the next lines (AutoNumber numbers these lines). I need the following fields to cascade down into those lines (Date, TimeStart, TimeOut) as I will have use for these fields in other queries later on. When I put the fields I need in the master and child properties (i.e. AutoNumber1;Date;), I get an error stating that Date is not a part of the object.

Please help :(
Oct 8 '08 #4

nico5038
Expert 2.5K+
P: 3,072
Do you have two tables or one ?

Nic;o)
Oct 8 '08 #5

P: 39
I changed it so that it is one table at this point.

Thanks for your input.
Oct 8 '08 #6

nico5038
Expert 2.5K+
P: 3,072
I would start with normalizing your table from tblProcessLine into tblProcessHeader and tblProcessLine.
This will allow automatic linking of the "Header" data with the "Line" data when using a Main and Sub form..

Checkout the Northwind sample .mdb.

Nic;o)
Oct 8 '08 #7

P: 39
That helped alot. Looking at the Northwind data base helped.

Thanks
Oct 9 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.