i have a form in which i type the batchnumber ( field name ) like 1005003, 1005010 and its stored in a table named tblbatchnumber
i have a folder which has pdf or xls files of that name like
ex : 1005003.xls or
ex : 1005010.pdf
how to link the file in folder to the batchnumber field so that when ever a new file is added in the folder the file name is stored as a new record in table & in the form if i click the batch number the xls or pdf file should open
pls help as it will save lot of time all who use it
i have tried hyperlink its not working & i have checked other different database i displays the complete path of file name
you have to write some code to scan the Folder and check if the batchnumber is in the database
here is code i use
aa = GenerateAllFolderInformation("D:\~WWW\Sites\frenchtouch.co.nz\Big")
aa = GenerateAllFolderInformation("D:\~WWW\Sites\frenchtouch.co.nz\thumbnails")
'MsgBox "Go Have a smoko"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set Folder = FSO.GetFolder(FolderName)
Set Files = Folder.Files
aa = 0
For Each File In Files
aa = aa + 1
CheckName = Mid$(File.Name, 1, InStr(File.Name, ".") - 1)
Checkit = DCount("*", "Prod", "[TYPE] ='" & CheckName & "'") + DCount("*", "Prod", "[Other Images] Like '*" & CheckName & "*'")
If Checkit = 0 And CheckName <> "" And CheckName <> "Thumbs" Then 'filename not in dataBase
' you put you code in here to added to database
FileCopy File, FolderName & "\Not Used\" & File.Name
'MsgBox "Have Finish Moving The Photos to" & vbNewLine & vbNewLine & "p:\photod\not used\"
i have a database that start at midnite and run the Clear_Photos function
you need to change the Dcount to match your needs
hope this help
See clear as mud
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.