MsgBox if Certain Criteria met

Kelsey

Registered User.
Local time
Today, 13:04
Joined
Aug 17, 2011
Messages
18
Hi all,

I have a form, frmIssueNew, that has 2 subforms in it. Subform1=IssueDetailSubNew, Subform2=FifoStock.

IssueDetailSubNew has relavant fields of PurchaseOrderDetailID, and IssueQuantity. FifoStock has PurchaseOrderDetailID, and AvailableQuantity.

Basically, I want to stop a person from Issuing a higher quantity than what is shown available in FifoStock.

Thanks
 
In the Before Update event of IssueQuantity, you would do something like this:
Code:
If Me.IssueQuantity > Me.Parent!FifoStock!AvailableQuantity Then
    Cancel = True
    Msgbox "Issue Quantity cannot be greater than Available Quantity" & vbnewline & vbNewline & "Field not updated", vbExlcamation, "Invalid Entry"
End If
 
Thank you! Greatly appreciated
 

Users who are viewing this thread

Back
Top Bottom