Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 34
  1. #16
    kirky is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    43

    The images i sent awhile ago with a highlights of yellow that what it pop-up when i click the button sir andy49

  2. #17
    kirky is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    43
    maybe the proper calling of the module which i name it ResursiveDir

  3. #18
    kirky is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    43
    Click image for larger version. 

Name:	Capture4.JPG 
Views:	15 
Size:	20.3 KB 
ID:	26898
    here is the error sir

  4. #19
    kirky is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    43
    Sir andy49,

    I still have error when i run compile and is referring to the bold word in the code i posted



    Code:
    Private Sub cmdgetfil_Click()
    Dim colFiles As New Collection
    Dim direc As String
    Dim filetosearch As String
    
    filetosearch = Me.RfiNo
    
    'you may need to add & ".pdf" onto the filetosearch line if the combobox doesn't have .pdf in it
    
    
    direc = "\\106.154.208.10\qaqc\011. RFI&RRI PDF FILES\02. RFI"
    RecursiveDir colFiles, direc, filetosearch, False
    Dim vFile As Variant
    For Each vFile In colFiles
    OpenAnyFile (vFile)
    Next vFile
    'keep as false for a few tests so it only looks in your current folder
    End Sub
    
    Function OpenAnyFile(strPath As String)
    If FileThere(strPath) Then
    FollowHyperlink strPath
    Else
    MsgBox ("File not found")
    End If
    End Function
    Function FileThere(FileName As String) As Boolean
    If (Dir(FileName) = "") Then
    FileThere = False
    Else:
    FileThere = True
    End If
    End Function
    
    Private Sub Form_Open(Cancel As Integer)
    Dim ID_Arg As Long
    
    ' load the openarg into the local variable id_arg
    
    ID_Arg = Nz(Form_InspectionDetailsfrm.OpenArgs, 0)
    
    ' check to see if the id_arg is not zero.  If not zero then we need to filter to select NCRecId
    
    If ID_Arg <> 0 Then
        ' ok we have a GC_ID so lets filter!
        Me.Filter = "SeqId=" & ID_Arg
        Me.FilterOn = True
    End If
    End Sub

  5. #20
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Did you get my private message kirky


    Sent from my iPhone using Tapatalk

  6. #21
    kirky is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    43
    I received your message sir andy49 and thank you so much for guiding me....
    I was able to run it but it will not search for a file in subfolders where the pdf is located.

  7. #22
    kirky is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    43
    I want to make it clear, the code actually working now and i tested it already using the full path where the pdf is located.
    But when i try to change the path putting the main folder only it wont work searching the pdf file inside the sub-folders

    Full path of the pdf file matching the textbox RfiNo ----------------\\106.154.208.10\qaqc\011. RFI&RRI PDF FILES\02. RFI\01. CIVIL\07. SAMSUNG\RO Area

    I want it sir andy49 to search and open pdf file inside the subfolders using the path of of main folder only if this one is possible.

    Thank you sir andy49

  8. #23
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Code:
    'Debug.Print strFolder
    Can you remove the ' from the line above in the recursiveDir function and then run it. Check in the immediate window and report back with what it says

  9. #24
    kirky is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    43
    sorry sir andy49 for late reply, I was busy with my work...
    the code actually working for specific folder only where the file is located and not searching recursively into subfolders.
    Aside from that if the file not found the msgbox does not appear.

  10. #25
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Quote Originally Posted by kirky View Post
    sorry sir andy49 for late reply, I was busy with my work...
    the code actually working for specific folder only where the file is located and not searching recursively into subfolders.
    Aside from that if the file not found the msgbox does not appear.
    Ok


    Can you replace this line
    Code:
    'Debug.Print strFolder
    with the line

    Code:
    msgbox strFolder
    Run the program again and send me a copy of exactly what the messagebox says please when it opens

  11. #26
    kirky is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    43
    Sir andy49,
    This is what is shown after the changes.
    Cannot search recursively the pdf file.

    Click image for larger version. 

Name:	Capture5.JPG 
Views:	9 
Size:	101.5 KB 
ID:	26937

  12. #27
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Thanks kirky. I'm sorry it's taking a while. The msgbox seems good. I wondered if the file you are searching for is actually in a sub folder or if it's in the main folder.


    Sent from my iPhone using Tapatalk

  13. #28
    kirky is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    43
    Sir andy49,

    Here below in photos attached the main folder in a network and sub-folders 1 to 3 or more sub-folders



    Main Folder
    Click image for larger version. 

Name:	Main_ShareFolderInNetwork.JPG 
Views:	9 
Size:	42.3 KB 
ID:	26940

    Sub-Folder_1
    Click image for larger version. 

Name:	1st_Subfolder.JPG 
Views:	9 
Size:	105.8 KB 
ID:	26941


    Sub-Folder_2
    Click image for larger version. 

Name:	2nd_Subfolder.JPG 
Views:	9 
Size:	66.5 KB 
ID:	26942

    Sub-Folder_3
    Click image for larger version. 

Name:	3rd_Subfolder.JPG 
Views:	9 
Size:	49.6 KB 
ID:	26943

  14. #29
    kirky is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    43
    Sir andy49,

    I ill try at home again the code. Thank you so much no words can i say... im really new to access vba and all i have to do know is just gather information to what i want to achieve in my database. I feel so excited to know more about it.

    Thank you so much

  15. #30
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    I'm working at present. It's top priority for me over the weekend.


    Sent from my iPhone using Tapatalk

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 09-10-2014, 01:15 PM
  2. Replies: 3
    Last Post: 08-28-2013, 11:08 PM
  3. Replies: 1
    Last Post: 06-06-2013, 06:12 PM
  4. Import multiple xls from a few subfolders
    By artec in forum Import/Export Data
    Replies: 6
    Last Post: 03-31-2012, 09:23 AM
  5. Open pdf file from Access form
    By lios1984 in forum Access
    Replies: 7
    Last Post: 02-21-2012, 01:11 PM

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