A
ADixon
Hi all
I'm trying to write a procedure that will set the validation for a text box
on a form. The text box validation will be based on a value chosen by the
user from a combo box. For example: if the user selects 'PLU' in the combo,
then the procedure runs and the validation is set to 'Like "PLU????" Or IS
Null'. If they choose EAN8 then the validation is set for this selection. I
can't seem to get the format for the validation string correct. Here is a
snippet which throws up a compile error 'expected end of statement':
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
I'm trying to write a procedure that will set the validation for a text box
on a form. The text box validation will be based on a value chosen by the
user from a combo box. For example: if the user selects 'PLU' in the combo,
then the procedure runs and the validation is set to 'Like "PLU????" Or IS
Null'. If they choose EAN8 then the validation is set for this selection. I
can't seem to get the format for the validation string correct. Here is a
snippet which throws up a compile error 'expected end of statement':
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