Dim strPLUValid As String
strPLUValid = "Like "PLU????" Or IS Null"
If Pack_Bcode_Type.Value = "PLU" Then
NewPack_Bcode.ValidationRule = strPLUValid
Else
End If
Any help is appreciated
That line is using embedded quotes incorrectly. Try using
this instead:
strPLUValid = "Like ""PLU????"" Or IS Null"
The rule is: To put a quote inside quotes, use two quotes.
OTOH, it is not clear that you really need to use the
validation rule instead of using code in the text box's
AfterUpdate event.
--
Marsh
MVP [MS Access]
This works exactly as i needed.
For clarification, i only chose to use code instead of normal validation as
i needed to have multiple rules within if statements based on the choice made
within the combo box.
Thanks for the help