I'm trying to validate data entered into a form field by using a
Query. I've discovered that the validation rule is pretty useless if
you need anything other than very basic validation.
I've tried using the following After Update Code:
Dim strSQL
strSQL = "SELECT tblProducts.ProductSRP FROM tblProducts"
strSQL = & "Where (((tblProducts.ProductID)=[Forms]![frmPeople]![Cases].[Form]![ProductID]));
if strSQL > Me.CompensationAmountTextBox.Value Then
MsgBox "The amount you entered is invalid"
Me.CompensationAmountTextBox.SetFocus
The idea is that this code validates the data entered and if invalid,
displays the msg box and sends the focus back to the field that
requires a valid entry.
I've also tried to get this to work by creating a Query and
referencing the Query from a Macro or with the expression builder,
with no success.
Can anyone suggest a way to do this?
Thanks,
Fred