0

I know how to get files from a folder to a table in access but as all the pdf documents have a name where the relation number is part of, I wonder if it's possible with vba to select all files containing for example number 12197 in its name, maybe with a like* * statement. The number could be not in same order in the filename.

Thanks

June7
  • 19,874
  • 8
  • 24
  • 34
  • What do you mean when say "The number could be not in same order"? You need to better define your need. The number is a number... Do you mean different numbers, but composed form those digits? Do you mean that the specific number can be anywhere in the file name? What do you really need? If the 'number' would be a real number you can use `If Instr("your path", "12197") > 0 Then`. – FaneDuru Mar 01 '20 at 19:19
  • Can't add files (attachment field?) en masse. Still have to loop through files in folder and do something with each file if there is a match to name template. – June7 Mar 01 '20 at 20:05
  • `If fileName Like "*12197*.pdf" Then` – Tim Williams Mar 01 '20 at 23:06

0 Answers0