Help with populating data in forms.

justdaflava

New member
Local time
Today, 08:38
Joined
Jun 17, 2006
Messages
2
See this image so you know whats going on:

168560405_1b8ea5cc82_o.jpg


This is a DATASHEET VIEW, not a table.

I have a table that has the part number, the description, and the usage.

I am stumped on trying to get just the 2 fields to populate into this subform (datasheet view), when the part number is selected. I may have several lines of part numbers. How do I go about populating this form? The user will indicate the actual quantity. The quantity changes per order, yet the usage stays the same.

Any suggestions?

Bradley
 
Set the row source of the PartNumber combo to something like
Code:
SELECT PartNumber, Description, Usage FROM Parts;
which selects the relevant data from the table and makes it available to the subform using the .Column() property of ComboBox.
Then set the control sources of Part_Number and Part_Usage textboxes to
Code:
"=cboPartNumber.Column(1)" and "=cboPartNumber.Column(2)"
respectively.
I also lock and disable those textboxes and give them a darker bgcolor to indicate they're for display only. Takes them out of the tab order, etc...
Cheers
 
Have a look at my sample (link below) It will do what you want, you can remove the price part if you do not want to use it. If you have a look at the tblInvoices you will see that instead of Full Customer Details being stored only the primary key is stored.

In tblInvoiceDetails you will see that instead of part number and decription on the primary key for the part is stored. The reason that the Price is stored is because prices can change and if you only had a link then when you changed a a price in the parts table all the prices effected in the tblInvoiceDetails would change. This way when you update prices in the parts table, data already stored in the tblInvoiceDetails will not change.


>>> Click Here <<<<
 
John, you just saved my bacon there - hadnt thought about price changes wrecking historical invoice infrmatoin. Thanks
 

Users who are viewing this thread

Back
Top Bottom