p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Microsoft Office > Access and Access VBA > Access VBA
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 9th, 2009, 04:50 PM
Registered User
Points: 38, Level: 1
Points: 38, Level: 1 Points: 38, Level: 1 Points: 38, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: Monroe, CT, USA.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 13th, 2009, 05:50 PM
Friend of Wrox
Points: 3,645, Level: 25
Points: 3,645, Level: 25 Points: 3,645, Level: 25 Points: 3,645, Level: 25
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,114
Thanks: 2
Thanked 4 Times in 4 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help regarding DoCmd Pramodhegde Access VBA 1 September 7th, 2007 08:05 AM
add image to report and send with DoCmd.SendObject marcin2k Access VBA 1 February 22nd, 2005 12:48 PM
DoCmd.RunQuery? reindeerw Access VBA 10 April 12th, 2004 05:19 PM
DoCmd.TransferDatabase poonjabba Access VBA 1 August 19th, 2003 08:57 PM
Where is DoCmd object? tonyso C# 0 July 28th, 2003 08:52 AM



All times are GMT -4. The time now is 02:21 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc