Results 1 to 7 of 7
  1. #1
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Some URLs contains ".pdf".
    For example: "c:\ABC\Access.pdf"
    How to filter records with the [URL] field containing ".pdf"?
    Currently I use:
    Me.Filter = "[URL] like '*pdf*'"
    Me.FilterOn = True

    but it won't work.
    Armstrong

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    In what sense doesn't it work? Do you get too many records? Or too few? Or the wrong ones?

  3. #3
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='787305' date='03-Aug-2009 20:31']In what sense doesn't it work? Do you get too many records? Or too few? Or the wrong ones?[/quote]
    No record is shown.
    Armstrong

  4. #4
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The screenshot shows after clicking PDF (button), not a single record is shown.
    Armstrong
    Attached Images Attached Images

  5. #5
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The subprocedure for the PDF button:

    Private Sub CmdPDF_Click()
    Me.Filter = "[URL] like '*pdf'"
    Me.FilterOn = True
    End Sub

    Armstrong

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Try changing

    Me.Filter = "[URL] like '*pdf'"

    to

    Me.Filter = "[URL] like '*.pdf*'"

    (A hyperlink field that refers to a file C:\Docs\Test.pdf actually contains #C:\Docs\Test.pdf#, so you must use a * after pdf too)

  7. #7
    3 Star Lounger
    Join Date
    Mar 2009
    Location
    Hong Kong
    Posts
    359
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='787317' date='03-Aug-2009 21:30']Try changing

    Me.Filter = "[URL] like '*pdf'"

    to

    Me.Filter = "[URL] like '*.pdf*'"

    (A hyperlink field that refers to a file C:\Docs\Test.pdf actually contains #C:\Docs\Test.pdf#, so you must use a * after pdf too)[/quote]
    Hi HansV,
    Your solution works instantly. Yes, now I got tons of pdf records. Thanks a lot.
    Armstrong

Posting Permissions

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