Results 1 to 5 of 5
  1. #1
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115

    Check for the presence of a picture.

    Hello, I need your help. I need to obtain a control of this type.
    If the folder C: \ cover, there is a cover whose name is simply the ID number associated with jpg extension, then in the text box to be shown the path, or if the file is not present, must leave the path empty. I would have written this command (I admit that not intuendomi programming, I tried to get there by reading the guides on the internet)
    My problem is that I would need that instead of C: \ 1.jpg were written "C: \ [ID]. Jpg". In practice, depending on the ID corresponding came for the given file. "Jpg" with the same number eg. if I get the ID 150 should be verified at the presence of the file C: \ 150.jpg
    file = "C:\1.jpg"
    Set fso = CreateObject("Scripting.FileSystemObject")
    If fso.FileExists(file) Then
    Me.[132] = "1.jpg"
    Else


    Me.[132] = vbNullString
    End If
    thanks
    Hello
    Last edited by RuralGuy; 08-08-2013 at 08:01 AM. Reason: Changed the subject to English

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Have you tried:
    file = "C:\" & Me.ID & ".jpg"

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    By the way, "FILE" is a reserved word: http://www.allenbrowne.com/AppIssueBadWord.html#F

  4. #4
    sergran is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Jun 2013
    Posts
    115
    thanks!!!!!!!!

  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Your welcome. Is your issue now resolved?

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums