Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2011
    Posts
    14

    Unanswered: Issues with wildcards

    Ok, another question for this image viewer. When using my simple image viewer, I came upon a realization. My current code searches for images in a series of folders based on an account number (RPC). For an account number of 11111, the resulting file number is R:\PO11\001111_01_01.jpg. My code works fine currently, but I just noticed that it will only scroll through 9 pictures. Some account numbers have more than 9 images. I see why. I have it set to look for picture _01.jpg, _02.jpg etc. The _0 is static though. Any picture over _09.jpg, like _10.jpg won't get picked up. Please see code below in red. How can I incorporate a wildcard (*,#,?) in my current code to get past this? Thanks in advance.

    pNum = 1 <--- pNum is set to 1 and then I have Next and Previous buttons that add or subtract 1 to scroll through them.dNum = 1
    Me.RPC.SetFocus
    Rec = Me.RPC.Text

    pth = "r:\" & "P0" & Left(Rec, 2) & "\"
    pFile = "00" & Rec & "_0" & dNum & "_0" & pNum & ".jpg"
    strFile = Dir(pth & pFile)

    If strFile <> "" Then

    Me.Ph.Picture = pth & pFile
    Me.PicNum.SetFocus
    Me.PicNum.Text = pNum
    End If

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Try:
    Code:
    pFile = "00" & Rec & "_0" & dNum & "_" & Format(pNum, "00") & ".jpg"
    Have a nice day!

  3. #3
    Join Date
    Apr 2011
    Posts
    14

    Thanks

    Perfect Sinddho, thank you.

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

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