MOD Worksheet function

  • Thread starter Thread starter Dimitris Nikolakakis
  • Start date Start date
D

Dimitris Nikolakakis

I have the following tables

STORAGE with ID, Name, Price, PackagingQty

STORAGETX with ID (autonumber), StorageID, Price, Quantity

I have created a form to insert STORAGETX records.

I know that there is a function MOD(number,divisor) and I want to use it to
check that if I divide the STORAGETX.Quantity with STORAGE.PackagingQty the
remainder is 0

Where can I use it ? I tried in the form, in the field Quantity in
Validation rule but I get error "The expression you enter contains invalid
syntax"

Any help is appreciated

Thanks
 
I know that there is a function MOD(number,divisor) and I want to use it to
check that if I divide the STORAGETX.Quantity with STORAGE.PackagingQty the
remainder is 0

Annoyingly enough, the Access Help provides help on the Excel Mod()
function - but the Access database engine does this operation in a
different manner! The Help file is to blame for your confusion.

Rather than a Function call use the MOD operator:

SELECT ...
WHERE STORAGETX.Quantity MOD STORAGE.PackagingQty > 0

will select all nonzero remainders.
 
Back
Top