Bookmarking finding a string

G

Guest

I am trying to find the first record and next record without using the Access
menu bar binocular control command button ie(The Find in Field) button. I
wanted to be able to use just part of the string. I was trying something
like:

Me.RecordsetClone.FindFirst "[Category] Like '*" & [Forms]![Bud]![Text17] &
"*'"
Me.Bookmark = Me.RecordsetClone.Bookmark

But this did not take me to the first item that I know exists and should
match.

How do I do this for finding a string within the entire field and go to that
record in the continuous form by coding it myself and not using the access
find?

Thanks,

Steven
 
M

Marshall Barton

Steven said:
I am trying to find the first record and next record without using the Access
menu bar binocular control command button ie(The Find in Field) button. I
wanted to be able to use just part of the string. I was trying something
like:

Me.RecordsetClone.FindFirst "[Category] Like '*" & [Forms]![Bud]![Text17] &
"*'"
Me.Bookmark = Me.RecordsetClone.Bookmark

But this did not take me to the first item that I know exists and should
match.

How do I do this for finding a string within the entire field and go to that
record in the continuous form by coding it myself and not using the access
find?


FindFirst should do what you want, but you should check
NoMatch to make sure a record was found. Just in case the
search text contains a ', I would use " because it's less
likely to occur in a data field:

With Me.RecordsetClone
.FindFirst "[Category] Like ""*" & Me.Text17 & "*"""
If .NoMatch Then
Beep
Else
Me.Bookmark = .Bookmark
End If
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top