Validation rule on VBA

Vugar

Registered User.
Local time
Today, 09:32
Joined
Sep 15, 2015
Messages
55
HI,


How I can write it "<=Nz(DLookUp("[SumOfQuantity]","[TotalInStock]"," ItemID = " & [ItemID] & "And [Status ID] = " & [Status ID]),0)" on VBA.

thanks
 
You can review Allen Browne's tips. But I would consider using vba code in the beforeUpdate event of the form where you capture the data.
 
I think you'd get more responses you you gave more info on what you're trying to accomplish. Maybe jdraw understands, but I don't.
If you're getting a syntax error, it looks like you have quotes within quotes. Maybe they need changed to apostrophes? Don't know since I don't understand the big picture.
"<=Nz(DLookUp('[SumOfQuantity]','[TotalInStock]',' ItemID = ' & [ItemID] & 'And [Status ID] = ' & [Status ID]),0)"
 
It's validation rule set in the form field on Stock DB.
And that rule for outgoing, so if outQuantity must be lower from incominqQuantity
I would like to learn it's possible to write this code on VBA.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom