Access

  • Thread starter Thread starter dsnyderwoo
  • Start date Start date
D

dsnyderwoo

Is there a way to include a value from a text box on a form as part of the
path name when using transferspread in a macro.
C:\documents\DeptScrapbyArea (insert deptNo from form text box).xls
 
Arvin Meyer said:
Yes. Use:

"C:\documents\DeptScrapbyArea" & Me.txtWhatever & ".xls"
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com





Arvin
Thank you for the reply I tryed your suggestion as the following string and
Access did not export the excel file using transferspreadsheet from the
macro. Do you see any mistake that I made setting up the path?
C:\Documents and settings\Dave Lecon\My
Documents\DeptScrapbyArea_BadPieces"Me.txt[forms]![DeptScrapbyArea]![DeptNo]&".xls
 
Yes 2 mistakes. It should look like this without newsreader line wrapping:

"C:\Documents and settings\Dave Lecon\My
Documents\DeptScrapbyArea_BadPieces" &
Me.txt[forms]![DeptScrapbyArea]![DeptNo] & ".xls"

Make sure you get all the spaces, quotes, and ampersands correct.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com


dsnyderwoo said:
Arvin Meyer said:
Yes. Use:

"C:\documents\DeptScrapbyArea" & Me.txtWhatever & ".xls"
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com





Arvin
Thank you for the reply I tryed your suggestion as the following string
and
Access did not export the excel file using transferspreadsheet from the
macro. Do you see any mistake that I made setting up the path?
C:\Documents and settings\Dave Lecon\My
Documents\DeptScrapbyArea_BadPieces"Me.txt[forms]![DeptScrapbyArea]![DeptNo]&".xls
 
Back
Top