Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run time error 2024 3

Status
Not open for further replies.

jivetrky

MIS
Jun 16, 2006
38
US
I found some VBA code to send an email with a report as an attachement. I am getting a run-time error 2024.

The report snapshot was not created because you do not have enough free disk space for temporary files.

What am I missing? Here is the code.

DoCmd.OutputTo acOutputReport, "Issues", "Snapshot Format", "C:\TEMP", False

Set outl = CreateObject("Outlook.Application")
Set mail = outl.CreateItem(olMailItem)
mail.To = "scshumate@bbandt.com"
mail.Subject = "Budgets"
mail.attachments.Add "C:\TEMP"
mail.display
SendKeys "^{ENTER}"

Set outl = Nothing
Set mail = Nothing
 
It's probably not your code. Right click your start button and select Explore. In the address bar, enter [!]C:\Temp[/!] and press enter.

Once the folder opens, click View>Customize this folder. This should show you how much disk space it is using. You may have to delete some files...

Hope this helps.

Tom

Live once die twice; live twice die once.
 
I also had a similar message (but can not remember the error number) when the name of my saved report was too long.
 
I thought of that myself. I'm confused because I am using 0 bytes in my temp folder.
 
I don't think its the length of my report name. It is called ISSUES, which is less than 8 digits. Any other ideas? I appreciate your suggestion.
 
You are not refering to the file but folder.
Code:
    DoCmd.OutputTo ObjectType:=acOutputReport, _
                   objectname:="Catalog", _
                   OutputFormat:=acFormatSNP, _
                   OutputFile:="C:\Temp\Catalog.snp", Autostart:=False
or simply
Code:
DoCmd.OutputTo acOutputReport, "Catalog", acFormatSNP, "C:\Temp\Catalog.snp", False


________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
That worked. Is there anyway I can send it to a word document instead of saving it as a snapshot?
 
Not *.doc but *.rtf

These are the formats available

acFormatASP
acFormatDAP
acFormatHTML
acFormatIIS
acFormatRTF
acFormatSNP
acFormatTXT
acFormatXLS

See more on help on topic "OutputTo Method"

You can delete the saved file from the disk after sending a copy
See "Kill Statement" in VBA help

________________________________________________________
Zameer Abdulla
Help to find Missing people
Sharp acids corrode their own containers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top