Results 1 to 3 of 3

Thread: Please help with code!!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    20

    Unhappy

    This is the code I have for a find form that searches through a datbase and the user can click click the name shown and the record is populated on the form.frmTable1.Data1.Recordset.FindFirst "[Appname] like '" & frmfind.DBCombo1.Text & "*'"
    The only problem is if the record contains an apostrophe and I try to open it ' I get a runtime error....Any help with this one?

    PLEASE HELP

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    Code:
    form.frmTable1.Data1.Recordset.FindFirst "[Appname] like '" & replace(frmfind.DBCombo1.Text,"'","''") & "*'"
    Try that... It should world.

    It replaces all single quotes with 2 single quotes thus convincing the database you really mean ONE single quote.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    20
    Thanks worked

Posting Permissions

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



Click Here to Expand Forum to Full Width