Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding A Record In Access

Status
Not open for further replies.

SandraF

Programmer
Jan 25, 2001
28
US
I have the follwing code in access to find a record based on a combo box that the user picks:

strSearching = "MovieName = '" & [MovieNameComboBox] & "'"
Me.RecordsetClone.FindFirst strSearching
Me.Bookmark = Me.RecordsetClone.Bookmark

It works unless the name they are looking for has an apostrophe in it (Bram Stoker's, etc). Is there special syntax that will allow the user to search for words that might have an apostrophe in it?

Also, the above code also works if there is a hyphen or other syntax in it, just not an apostrophe.

THanks!
 
Hi!

I faced this problem. I soved it following:

Dim rst As Recordset
Set rst = Me.RecordsetClone
With rst
Do While Not .EOF
If !UnitName = Me.MyCriteria Then
'Your codes

Exit Do
End If
.MoveNext
End If
End With
Me.Bookmark = rst.Bookmark
rst.Close
Set rst = Nothing

Aivars
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top