access question

zerocool1

Diamond Member
Jun 7, 2002
4,486
1
81
femaven.blogspot.com
Hello



also,
question 1


is some code that i have. i want to export a table to an excel spreadsheet. But it gives me an error saying "compile error expected: ="

Old question-
is there a way to have access do an append query without any prompt/warning to the user?
-Thanks KLin

filename = stState & "--" & stTrans & Month(Date) & "-" & Day(Date) & "-" & Year(Date) & "-" & Hour(Time) & Minute(Time) & ".xls"
doCmd.TransferSpreadsheet(acExport,acSpreadsheetTypeExcel9,filename)
it turns out that i'm not supposed to be using parenthesis.

Thanks,

Amit


----------
This is the programming forum, not FS/FT; do not bump your thread. It is considered neffing, and neffing is not allowed.

AnandTech Moderator Evadman

 

KLin

Lifer
Feb 29, 2000
30,953
1,080
126
from vba code:

docmd.setwarnings false
docmd.openquery "appendqueryname"
docmd.setwarnings true

Consider putting in error capturing though. see example below

Private sub cmdAppend_click()
On Error goto err_cmdAppend_click

docmd.setwarnings false
docmd.openquery "appendqueryname"
docmd.setwarnings true

exit_cmdAppend_Click:
docmd.setwarnings true
Exit Sub

err_cmdAppend_click:
msgbox err.description
resume exit_cmdAppend_click

If the query errors out, then warnings are still set to false if no error capturing is put into the code. You won't be prompted for a warning when doing things, say like closing an unsaved query, deleting a record, etc.