Doing something Stupid

Hey Everyone,

I am making an inventory program and im trying to make sure the user can not remove more stock than currantly in stock.

I have a parts Table, and a Nested form inside of another table. The nested form is called โ€œrepair parts usedโ€

In the [Amount] Column of the Repair parts used, i am trying to put in a valid if expression like so,
[Amount] - (LOOKUP( [_THISROW].[Part Name], โ€œPartsโ€, โ€œIDโ€, โ€œStockโ€))> -1
or [_THIS].[Amount] - (LOOKUP( [_THISROW].[Part Name], โ€œPartsโ€, โ€œIDโ€, โ€œStockโ€))> -1
Taking checking to see if the currant inputted number - the amount currently in stock is bigger than -1.

Its telling me the following error,

Arithmetic expression โ€˜([Amount]-ANY(SELECT(Parts[Stock],([Id] = [ID].[Part Name]))))โ€™ has inputs of an invalid type โ€˜Unknownโ€™

Any input would be appreciated,

Thanks again,

Solved Solved
1 3 201
1 ACCEPTED SOLUTION

Ha, Im an idiot. I always post stuff 2 minutes to early. I figured it out. One of my columns was not of Type Number

My entire expression was also backwards.

Final answer
(LOOKUP( [_THISROW].[Part Name], โ€œPartsโ€, โ€œIDโ€, โ€œStockโ€))-[Amount] >-1

View solution in original post

3 REPLIES 3

Try:

([Amount] - LOOKUP([_thisrow].[Part Name], Parts, Id, Stock)) > -1

Ha, Im an idiot. I always post stuff 2 minutes to early. I figured it out. One of my columns was not of Type Number

My entire expression was also backwards.

Final answer
(LOOKUP( [_THISROW].[Part Name], โ€œPartsโ€, โ€œIDโ€, โ€œStockโ€))-[Amount] >-1

Been there, no worries

Top Labels in this Space