Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / May 2007

Tip: Looking for answers? Try searching our database.

Code Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sandy - 27 May 2007 00:29 GMT
The following is apparently a known problem in access 2003 - an apostrophe
in the combo box item causes an error - how is it corrected?

Sandy

Private Sub Combo32_AfterUpdate()
   ' Find the record that matches the control.
   Dim rs As Object

   Set rs = Me.Recordset.Clone
   rs.FindFirst "[Title] = '" & Me![Combo32] & "'"
   If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
Rob Parker - 27 May 2007 00:51 GMT
You can use a pair of double-quote characters as your string delimiter:
   rs.FindFirst "[Title] = """ & Me![Combo32] & """"

Expanded for clarity, that is:
   rs.FindFirst "[Title] = " " " & Me![Combo32] & " " " "

HTH,

Rob

> The following is apparently a known problem in access 2003 - an apostrophe
> in the combo box item causes an error - how is it corrected?
[quoted text clipped - 9 lines]
>    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
> End Sub
Sandy - 30 May 2007 12:06 GMT
Perfect Rob - Thank You
Sandy

> You can use a pair of double-quote characters as your string delimiter:
>    rs.FindFirst "[Title] = """ & Me![Combo32] & """"
[quoted text clipped - 19 lines]
>>    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
>> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.