Soooo Close...how to name file

  • Thread starter Thread starter Guest
  • Start date Start date
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!!!
 
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!!!
 
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!!!
 
Back
Top