Using a Value in an Export

alexfwalker81

Member
Local time
Yesterday, 17:47
Joined
Feb 26, 2016
Messages
107
I feel like this might not be possible, but how can I use a value from the query to create a dynamic file name where I've indicated [VARIABLE HERE] in the image below?

The function makedir() will have created the dynamic folder name, ready to be used.

VARIABLE.png
 
FYI. Most people here do not use macros and opt for VBA. If you want to do this in VBA then it is a pretty common thing to do. Maybe someone who works with macros can help.
 
Hi. How do you plan on getting the value to use into the variable? Just curious...
 
After doing a web search and recalling my own attempts to document macros with an analyzer I once wrote, I have to say I have my doubts. The trick is finding the text of the macro and identifying the line you wanted to edit. I've seen the question asked maybe a dozen times on multiple sites that used VBA behind the main product (Access, Excel, and Word being the ones I saw most commonly) and the consensus was "convert the macro to code, at which point the problem becomes much easier."

It is possible that my search missed an article that contains the answer, but I tried several variants of the question before giving up.
 
It's fine, I can do it in VBA. I was just being a bit lazy really, and hoping there was a feature in that interface that I could take advantage of. No worries, I'll do it the long way!
 
That's exactly why I was thinking it wasn't going to be possible, but just wondered.
Actually, I think it is very possible. I just needed to know where the value was coming from.

For example, will the user input it in a box or a form?
 
Ah, ok - it's [pick_no] in the qry_to_print_BOUN
In that case, maybe you could use a DLookup() action. You could either use DLookup() directly in the file path or create a LocalVar for the DLookup() result and then use the LocalVar in the file path argument.
 

Users who are viewing this thread

Back
Top Bottom