Soooo Close...how to name file

G

Guest

Hi there! Using A02 on XP. Not a programmer but lovin' learnin', learnin'
lovin'.

I am using a button's OnClick Event to run a 'Transfer Spreadsheet' macro
command to export a file. I want to name the file whatever the value of a
field [RunThisOne] on my form is. I typed this on the File Name line of my
Action Argument:

S:\RPS\PTS\Census\&[Forms]![fCensus1Conversion]![RunThisOne]&.xls

But the file that is created is called
&[Forms]![fCensus1Conversion]![RunThisOne]&.xls rather than GP0321.xls or
GP8221.xls, etc. Argh! What am I missing? Can someone help?

Thanks in advance for any help or advice!!!
 
J

John Nurick

Hi Bonnie,

Glad you're enjoying yourself! I seldom use macros but I think you need
sometinglike this (all on one line, of course). The = sign tells Access
it's an expression to evaluate rather than a literal string of
characters.

="S:\RPS\PTS\Census\" & [Forms]![fCensus1Conversion]![RunThisOne] &
".xls"

Hi there! Using A02 on XP. Not a programmer but lovin' learnin', learnin'
lovin'.

I am using a button's OnClick Event to run a 'Transfer Spreadsheet' macro
command to export a file. I want to name the file whatever the value of a
field [RunThisOne] on my form is. I typed this on the File Name line of my
Action Argument:

S:\RPS\PTS\Census\&[Forms]![fCensus1Conversion]![RunThisOne]&.xls

But the file that is created is called
&[Forms]![fCensus1Conversion]![RunThisOne]&.xls rather than GP0321.xls or
GP8221.xls, etc. Argh! What am I missing? Can someone help?

Thanks in advance for any help or advice!!!
 
G

Guest

John!!! You have started my new year off with a BANG! That little line will
save me beaucoup design time. It works beautifully. I'm really loving
learning and am truly grateful for folks like you that help folks like me.
Thanks for the time you put into the newsgroups!
--
Bonnie


John Nurick said:
Hi Bonnie,

Glad you're enjoying yourself! I seldom use macros but I think you need
sometinglike this (all on one line, of course). The = sign tells Access
it's an expression to evaluate rather than a literal string of
characters.

="S:\RPS\PTS\Census\" & [Forms]![fCensus1Conversion]![RunThisOne] &
".xls"

Hi there! Using A02 on XP. Not a programmer but lovin' learnin', learnin'
lovin'.

I am using a button's OnClick Event to run a 'Transfer Spreadsheet' macro
command to export a file. I want to name the file whatever the value of a
field [RunThisOne] on my form is. I typed this on the File Name line of my
Action Argument:

S:\RPS\PTS\Census\&[Forms]![fCensus1Conversion]![RunThisOne]&.xls

But the file that is created is called
&[Forms]![fCensus1Conversion]![RunThisOne]&.xls rather than GP0321.xls or
GP8221.xls, etc. Argh! What am I missing? Can someone help?

Thanks in advance for any help or advice!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top