S
SCHNYDES
Hi all,
Just need a second look on some code I'm development in a form's LostFocus
event.
I am trying to generate an error message when cetrain options are selected
in the form, Option 1, 2 and 3. Option 1 having a validation rule of the
field BATCHID being 15 chars in length and starting with L. Option 2 having
a rule where BATCHID is no more or less than 15 chars in length. Option 3
having a rule similar to option 1, where BATCHID is 15 chars in length and
begins with F.
The following code I have is from an older version of this DB that I'm
trying to morph, it represents the error messages associated with breaking
the validation rule:
If Me![Options] = 2 Then
If Me!BatchId = "Like '???????????????'" Then
Me!Options.TabStop = False
ElseIf Me![Options] = 1 Then
If Me!BatchId = "Like 'L??????????????'" Then
Me!Options.TabStop = False
ElseIf Me![Options] = 3 Then
If Me!BatchId = "Like 'F??????????????'" Then
Me!Options.TabStop = False
ElseIf Me!BatchId = "Like '???????????????'" Then
MsgBox "Please check to make sure your batch id has 15
characters."
Me!Options.TabStop = False
GoTo Exit_Batch_Number_LostFocus
Else
MsgBox "You have selected the wrong Batch Number Type. Please
select the right type."
Me!Options.TabStop = True
GoTo Exit_Batch_Number_LostFocus
End If
I could use some help making it work properly, any thoughts would be
appreciated.
Just need a second look on some code I'm development in a form's LostFocus
event.
I am trying to generate an error message when cetrain options are selected
in the form, Option 1, 2 and 3. Option 1 having a validation rule of the
field BATCHID being 15 chars in length and starting with L. Option 2 having
a rule where BATCHID is no more or less than 15 chars in length. Option 3
having a rule similar to option 1, where BATCHID is 15 chars in length and
begins with F.
The following code I have is from an older version of this DB that I'm
trying to morph, it represents the error messages associated with breaking
the validation rule:
If Me![Options] = 2 Then
If Me!BatchId = "Like '???????????????'" Then
Me!Options.TabStop = False
ElseIf Me![Options] = 1 Then
If Me!BatchId = "Like 'L??????????????'" Then
Me!Options.TabStop = False
ElseIf Me![Options] = 3 Then
If Me!BatchId = "Like 'F??????????????'" Then
Me!Options.TabStop = False
ElseIf Me!BatchId = "Like '???????????????'" Then
MsgBox "Please check to make sure your batch id has 15
characters."
Me!Options.TabStop = False
GoTo Exit_Batch_Number_LostFocus
Else
MsgBox "You have selected the wrong Batch Number Type. Please
select the right type."
Me!Options.TabStop = True
GoTo Exit_Batch_Number_LostFocus
End If
I could use some help making it work properly, any thoughts would be
appreciated.