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,

1 Like


([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 :slight_smile:

My entire expression was also backwards.

Final answer
(LOOKUP( [_THISROW].[Part Name], “Parts”, “ID”, “Stock”))-[Amount] >-1


Been there, no worries :nerd_face: