|
|
 |
| Access VBA Discuss using VBA for Access programming. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
|
 |

July 9th, 2009, 04:50 PM
|
|
Registered User
|
|
Join Date: Jul 2003
Location: Monroe, CT, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Add variables to the DoCMD
I am new to some of VBA. I want to take the following statement and make
PR_WINTER a variable
"N:\ROI_08\Reports\ROILIVE" & Format(Date, "MMDDYY") a variable
DoCmd.TransferSpreadsheet acExport, 8, "PR_WINTER", "N:\ROI_08\Reports\ROILIVE" & Format(Date, "MMDDYY"), True, ""
I can't seem to find this information anywhere in all my books.
Any help would be appreciated.
Thanks
Bill
Last edited by baNTON : July 10th, 2009 at 09:23 AM.
|

July 13th, 2009, 05:50 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,134
Thanks: 2
Thanked 7 Times in 7 Posts
|
|
To make it a variable, you need to declare a string, assign it and put the string variable in the place of "PR_WINTER". That is...
Dim strSpreadsheet as String
strSpreadsheet = "PR_WINTER"
DoCmd.TransferSpreadsheet acExport, 8, strSpreadsheet, "N:\ROI_08\Reports\ROILIVE" & Format(Date, "MMDDYY"), True, ""
__________________
Greg Serrano
Michigan Dept. of Environmental Quality
Air Quality Division
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |