|
|
 |
| 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

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,114
Thanks: 2
Thanked 4 Times in 4 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
|
|
|
|
 |