computations not putting result in correct field..

Copper Contributor

three fields are on the sub form. It is accessing the data correctly from the source table, but the result is not stored in the correct field. Here is the computation:

 

If Me![Workorder Line Item Quantity] > 0 Then Me![Workorder Line Item Amount] = Me![Workorder Line Item Quantity] * Me![workorder line item amount base] Else Me![Workorder Line Item Amount] = Me![workorder line item amount base]

 

It recognizes the If clause, but the computed result is stored in the [workorder line item base] field, not the [workorder line item amount] field. 

5 Replies

@dmsitech am I guessing correctly that you have this code as the expression for a calculated field?

@Tom_van_Stiphout 

 

It is a calculated field on the form. The result is stored in a field on the db.

 

here is the code

 

If Me![Workorder Line Item Quantity] > 0 Then Me![Workorder Line Item Amount] = Me![Workorder Line Item Quantity] * Me![workorder line item amount base] Else Me![Workorder Line Item Amount] = Me![workorder line item amount base]

 

it is recognizing the "If" statement, but the result is stored in work order line amount base. the result should end up in workorder line item amount

 

 

 

I believe i need someone to look at the actual form and underlying db

i did connect with MS Support who looked at the db and said there are no errors, so they pointed me to the forum.

How can i get hands on help?

@dmsitech Share your database so we can look at it. Attach the file to your message or provide a link to a shared location (e.g. OneDrive or GoogleDrive).

best is not to save the Computation in a Field (Workorder Line Item Amount), but just calculate it in a Query and use the Query as the RowSource of your form.

select field1, field2,
IIF(Nz([Workorder Line Item Quantity], 0) > 0, [Workorder Line Item Quantity], 1) * [workorder line item amount base] AS [Workorder Line Item Amount] FROM yourTableName