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 199
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