Hi,
should be:
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
ElseIf rs.NoMatch Then
MsgBox "Must be a valid tag number"
Cancel = True
End If
line:
If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark
is considered as complete statement

Signature
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
> Hi,
>
[quoted text clipped - 25 lines]
>
> Mabeline
Mabeline - 17 Oct 2007 20:39 GMT
Thanks Alex, this worked well. Such a small change but it makes a hell of a
difference.
Mabeline.
> Hi,
> should be:
[quoted text clipped - 39 lines]
> >
> > Mabeline
> Hi,
>
[quoted text clipped - 25 lines]
>
> Mabeline
Access will interpret this line:
> If Not rs.NoMatch Then Me.Bookmark = rs.Bookmark
as a complete statement, so the ElseIf line has no starting If.
The code should be re-worked like this:
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
ElseIf rs.NoMatch Then
MsgBox "Must be a valid tag number"
Cancel = True
End If
Also, because you are testing the same value (rs.NoMatch) on both sides of
the statement, you can use Else instead of ElseIf, thereby only making the
comparison once:
If Not rs.NoMatch Then
Me.Bookmark = rs.Bookmark
Else
MsgBox "Must be a valid tag number"
Cancel = True
End If
Mabeline - 17 Oct 2007 20:38 GMT
Stuart,
Thank you very much. Such a small thing change to what I had but it makes a
hell of a difference.
Mabeline.
> > Hi,
> >
[quoted text clipped - 51 lines]
> Cancel = True
> End If