Table question

gear

Registered User.
Local time
Today, 07:37
Joined
Mar 10, 2007
Messages
112
I have created a table with customer name, address
Second table with product name, unit price
I also created a third table with fields from these two tables and the last field Total price.
I created a form for data entry with fields from the third table with combos.

What I want is if I select a customer name, his address should also appear automatically in the address field. Similarly, when I select a product, the unit prices also should appear in the relevant field.
In the total field, I the total of the items selected.
How is it done? Would someone help?
 
Combo Box. Create queries for your combo boxes based on the tables and data you want to bring. ie "CustomerName","Address","PhoneNumber"....etc
In the combo box bring the whole query, use the column number (eg 3)
Bound column = 1 (CustomerName)
and set widths to 3cm;0cm;0cm etc. That way only the Customer Name will show in the combo box.
On afterUpdate Event on your customer combo box, you can call the other values in the combo box into what ever other fields on the form you like.

Code:
Me.txtCustomerAddress = Me.cboCustomer.Column(1)
Me.txtCustomerPhone = Me.cboCustomer.Column(2)

I hope that makes sense mate.
There are heaps of examples here of just this issue. If you need more let us know.

:)
 
Combo box behaves wierdly

Thanks for your reply. I got it done.
I have 34 items in the list and my combo lists all the 34 items. But it is not taking some of my selections and instead it selects something else. I list here the item number I select in the drop down list and the item number the combo selects in brackets: 11(1), 14(5), 15(6), 16(3), 23(3), 25(20), 26(18), 27(18), 29(4), 31(4), 32(20), 34(21). Any solution?
 

Users who are viewing this thread

Back
Top Bottom