Solved Order Form Query (1 Viewer)

debsamguru

Member
Local time
Today, 22:41
Joined
Oct 24, 2010
Messages
82
Hi, I have an order form which uses the tables CustomerT and OrderHeaderT with a subform for the order details. The Order Form has a combo box to select which supplier the order is from and puts the SupplierID (from the SupplierT) nto the OrderHeaderT.Supplier field. This has all been working fine.

However, I now need to use a couple of fields on the SupplierT to calculate dates on the OrderHeaderT. e.g. the OrderHeaderT.DeliveryDate = OrderHeaderT.RequiredDate - SupplierT.DispatchDays.

I can't use the SupplierT in the original form because until the Supplier has been selected on the form, there is no Suppler to link to. What is the best way to do this?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:41
Joined
Feb 19, 2013
Messages
16,618
which supplier the order is from
Presume you mean To?

Not sure you can do what you want - if the SupplierT.DispatchDays is not known - what would you use in it's place?
 

debsamguru

Member
Local time
Today, 22:41
Joined
Oct 24, 2010
Messages
82
I can get the data if I include it as a field in the combobox but how do then utilise it on the form?
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:41
Joined
Feb 19, 2013
Messages
16,618
refer to the column

say you currently have 2 columns

0.........1
PK......Name

add a third

0.........1............2
PK......Name...dispatchdays

then in your calculation (assuming your combo is called cboSupplier)

OrderHeaderT.DeliveryDate = OrderHeaderT.RequiredDate - cboSupplier.column(2)
 

debsamguru

Member
Local time
Today, 22:41
Joined
Oct 24, 2010
Messages
82
Thank you. I'm nearly there.

The columns in the combobox are SupplierID, SupplierCode, SupplierName, SupplierProductionDays, SupplierDispatchDays. I display columns 2 and 3 in the dropdown box (ignoring column 1 by setting the column width of column 1 to 0 so only the SupplierCode and SupplierName is shown. I can happily display column 4 using cboSupplier.column(3) to show the SupplierProductionDays but when I use the same logic to display the SupplierDispatchDays (cboSupplier.column(4), nothing is displayed - the output is blank even though I know there is data there.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 22:41
Joined
Feb 19, 2013
Messages
16,618
Check how many columns you have on the data property tab
 

Users who are viewing this thread

Top Bottom