Need help with a simple macro (1 Viewer)

Nick.NZ

New member
Local time
Today, 19:42
Joined
Nov 14, 2021
Messages
15
Hi there,

I'm trying to sort out a macro so if the quantity supplied > quantity ordered, it gives an error, and won't update the quantity supplied field on a sub form with the higher number.

If the quantity supplied < quantity ordered, i want it to minus the quantity supplied from the stock level.

So far these two things work, but it'll still input the number into the quantity supplied field even if it's higher, which isn't what I want to happen

I currently have this (see screenshot 10 below). I realize im missing a command, I just don't know what it is.

any help would be appreciated.
 

Attachments

  • screeen10.JPG
    screeen10.JPG
    22.6 KB · Views: 18
  • screen12.JPG
    screen12.JPG
    58.5 KB · Views: 33

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:42
Joined
May 7, 2009
Messages
14,648
on QuantitySupplied add Macro on BeforeUpdate Event:
quantity_supplied.png
 

oleronesoftwares

Registered User.
Local time
Yesterday, 22:42
Joined
Sep 22, 2014
Messages
148
Another way around it is to use Field validation rules at form level , in the validation rule property of the quantity supplied field you can add <=quantity ordered
 

Users who are viewing this thread

Top Bottom