• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

access question

zerocool1

Diamond Member
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

 
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.
 
Back
Top