Get folder name (1 Viewer)

Dzib

New member
Local time
Yesterday, 21:12
Joined
Oct 15, 2019
Messages
6
Hi,


New to this forum and to access, I try to build a small form where I need, when the user create a new record, to go to a specific folder, find the last subfolder (something like F19_1245 where 19 is the current year and 1245 is the record number) and then, create a new subfolder increased by 1 (in this case, F19_1246).
Do you think it's possible? I know how to make a folder but can't find out how to get the last subfolder name...


Thanks ;)
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:12
Joined
Oct 29, 2018
Messages
21,455
Hi. Welcome to AWF! You can use the Dir() function to loop through the folders. Where does the record number come from? Did you say you want to create a subfolder under the last folder you found?
 

Dzib

New member
Local time
Yesterday, 21:12
Joined
Oct 15, 2019
Messages
6
Thanks, that's the problem, the record number can only be found in these subfolders names.

I have a folder named 2019 and within that folder, I have 1245 subfolders (F19_0001 to F19_1245 and I want to create a new subfolder each time the user create a new record (F19_1246 then F19_1247,....)
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 21:12
Joined
Oct 29, 2018
Messages
21,455
Thanks, that's the problem, the record number can only be found in these subfolders names.

I have a folder named 2019 and within that folder, I have 1245 subfolders (F19_0001 to F19_1245 and I want to create a new subfolder each time the user create a new record (F19_1246 then F19_1247,....)

Okay. There may be a better way but one approach I could suggest is grab a sample code to store the folder names in a table. Using queries or code, you will be able to determine the next folder name to use for the new folder.
 

Dzib

New member
Local time
Yesterday, 21:12
Joined
Oct 15, 2019
Messages
6
That's a good idea, I'll try that
Thanks
 

Users who are viewing this thread

Top Bottom