Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculated field used in auto-fillin

Status
Not open for further replies.

DLynnTX

IS-IT--Management
Dec 9, 2004
67
US
I have an order-entry database that I pick up the item# from and want to auto-fill the price. However, the price is based on a calculation of the Price/Ton and Wt/Ft and is a Price/Ft price. If I try to use the Price/Ton (not a calculation) it works fine. If I use the Price/Ft, it does nothing. The item is selected from a lookup (query) that has four fields (item, wt/ft (calculated), price/ton, and price/ft(calculated). I am using the following After update event when I select the item.

Me.Price = Me.Combo17.Column(3)

As I said, if I substitute Column(2), it picks up the price/ton. What am I doing wrong? I have searched this site and tried different scenerios for 2.5 hours - I'm stuck.

Thank you
 
DLynnTX
Column indexes start at 0. Therefore, Column(2) is the third column.

Tom
 
I may have stated the column numbers wrong, but it isn't a problem with the column number. I have tried ALL of the columns and the only one that works is the price/ton (the others are calculated fields, and therefore, it must be directly related to the fact that I am using calculated fields).
 
If the calculated fields are in the query behind the combo box, then the Price text box should fill.

You say that the Price is a calculation of 3 fields in the query behind the combo box, Price/Ton and Wt/Ft and Price/Ft. I'm not sure how you you are putting those together to get the price you want to charge...but whatever the method, it seems to me that you will have to either (a) put that calculation as an additional field in the combo box and reference that column, or (b) make that calculation the control source for your Price text box.

Tom
 
I'm only using Wt/Ft and Price/Ft to get the price calculation I want to use. Price/Ton is an entered number and it works fine in the combo box. I'll try those suggestions. Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top