Ok, I've checked the FAQ on this one but...

Results 1 to 3 of 3

Thread: Ok, I've checked the FAQ on this one but...

  1. #1
    Join Date
    Dec 1969

    Default Ok, I've checked the FAQ on this one but...

    No luck.<BR><BR>Actually this one involves ACCESS 2002 after writing a record from an ASP form that has an apostrophe in it.<BR><BR>I have a form in access that I view these records with, and one of the fields is a combo box with a drop down list. When I choose a title from that list that has a n apostrophe in it, Access generates a runtime error 3077.<BR><BR>Here&#039;s the code that Access has generated for the lookup:<BR>---------------------------------------------------------<BR>Private Sub Combo85_AfterUpdate()<BR> &#039; Find the record that matches the control.<BR> Dim rs As Object<BR><BR> Set rs = Me.Recordset.Clone<BR> rs.FindFirst "[title] = &#039;" & Me![Combo85] & "&#039;"<BR> If Not rs.EOF Then Me.Bookmark = rs.Bookmark<BR>End Sub<BR>Here&#039;s the code that Access has generated for the lookup:<BR>---------------------------------------------------------<BR>The error occurs in the rs.FindFirst line (third from the bottom).<BR><BR>Do I need to make sure that apostrophes are stripped out of that field due to being a lookup field? Or is there another way around it?<BR><BR>Thanks again!

  2. #2
    Join Date
    Dec 1969

    Default Look again!


  3. #3
    Join Date
    Dec 1969

    Default Where is FINDFIRST documented???

    I don&#039;t find it in the ADO docs, at all.<BR><BR>At least not in ADO version 2.7.<BR><BR>And even though FindFirst isn&#039;t in those docs, look at the docs for FILTER:<BR>http://msdn.microsoft.com/library/en-us/ado270/htm/mdprofilter.asp<BR>See what they have to say about using &#039; in filters.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts