More Help with Forms and output file path

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I got this to work great thanks to you guys:

="c:\" & [Forms]![frm_rebate_vendor]![vendor_name] & [Forms]![frm_rebate_main]![combo5].[column](1) & " Rebate Report" & ".xls"

Now what I would like to do is use a form value to select the directory for the file as well. Such as:

="c:\" &forms!frm_rebate_vendor!vendor_name &"\" &[Forms]![frm_rebate_vendor]![vendor_name] & [Forms]![frm_rebate_main]![combo5].[column](1) & " Rebate Report" & ".xls"

I guess I would really like to go ahead and put it a couple of levels down such as ="c:\my documents\rebates\" & forms!frm_rebate_vendor!vendor_name &"\" &[Forms]![frm_rebate_vendor]![vendor_name] & [Forms]![frm_rebate_main]![combo5].[column](1) & " Rebate Report" & ".xls"

Is this even possible?
 
Michael,

It's definitely possible, but wouldn't it be simpler and faster to try it
straight away than post the question and wait for an answer?

Nikos

Michael said:
I got this to work great thanks to you guys:

="c:\" & [Forms]![frm_rebate_vendor]![vendor_name] &
[Forms]![frm_rebate_main]![combo5].[column](1) & " Rebate Report" & ".xls"
Now what I would like to do is use a form value to select the directory
for the file as well. Such as:
="c:\" &forms!frm_rebate_vendor!vendor_name &"\"
&[Forms]![frm_rebate_vendor]![vendor_name] &
[Forms]![frm_rebate_main]![combo5].[column](1) & " Rebate Report" & ".xls"
I guess I would really like to go ahead and put it a couple of levels down
such as ="c:\my documents\rebates\" & forms!frm_rebate_vendor!vendor_name
&"\" &[Forms]![frm_rebate_vendor]![vendor_name] &
[Forms]![frm_rebate_main]![combo5].[column](1) & " Rebate Report" & ".xls"
 
Michael,

Have you checked that all your references in your syntax are correct? To do
so, modify your code so you construct the path and file name string and
assign it to a variable, so you can check its value before you run the
actual export / output method:

vFile = ="c:\" & forms!frm_rebate_vendor!vendor_name & "\" ....
Debug.Print vFile

Open the immediate window (Ctrl+G) and check the value of vFile printed, to
make sue it is what you expected.

HTH,
Nikos

Michael said:
I agree. I did try the examples and I have been trying to get this to
work, but no success on my side. I either get a "can't Parse" or "can't
write" error.
Nikos Yannacopoulos said:
Michael,

It's definitely possible, but wouldn't it be simpler and faster to try it
straight away than post the question and wait for an answer?

Nikos

Michael said:
I got this to work great thanks to you guys:

="c:\" & [Forms]![frm_rebate_vendor]![vendor_name] &
[Forms]![frm_rebate_main]![combo5].[column](1) & " Rebate Report" & ".xls"
Now what I would like to do is use a form value to select the
directory
for the file as well. Such as:
="c:\" &forms!frm_rebate_vendor!vendor_name &"\"
&[Forms]![frm_rebate_vendor]![vendor_name] &
[Forms]![frm_rebate_main]![combo5].[column](1) & " Rebate Report" & ".xls"
I guess I would really like to go ahead and put it a couple of levels
down
such as ="c:\my documents\rebates\" & forms!frm_rebate_vendor!vendor_name
&"\" &[Forms]![frm_rebate_vendor]![vendor_name] &
[Forms]![frm_rebate_main]![combo5].[column](1) & " Rebate Report" & ".xls"
Is this even possible?
 
Back
Top