Need help with a simple macro (1 Viewer)

Nick.NZ

New member
Local time
Today, 15:54
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: 199
  • screen12.JPG
    screen12.JPG
    58.5 KB · Views: 301

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 11:54
Joined
May 7, 2009
Messages
19,226
on QuantitySupplied add Macro on BeforeUpdate Event:
quantity_supplied.png
 

oleronesoftwares

Passionate Learner
Local time
Yesterday, 20:54
Joined
Sep 22, 2014
Messages
1,159
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