Using this code for testing:
to test:Code:Private Sub Command50_Click() If Me.Quantity_to_inv > Me.remaining Then MsgBox "Value exceeds available quantity" Cancel = True Me.Inv_Quantity.SetFocus Else MsgBox "Created Invoice" End If End Sub
* I have two lines on the form. One passes this rule. One doesn't.
* when this code is assigned to a button in the footer, then then we get the message "created invoice".
* when assigned to a button on a line, the message is "Value exceeds available quantity" <- this is on both lines despite one of them being correct.
So in both places this does not do as I want.
The problem is, I don't want the ability to create an invoice that will exceed the order value. Each order has multiple lines so the have to all pass this validation rule.
Anyone have a suggestion? thanks.