Template Wizard - "Saving to Database" Problem

  • Thread starter Thread starter pam asar
  • Start date Start date
P

pam asar

Hi everyone,

Using the "Template wizard" add-in, I've created an XLT
file with the ms Access database on the back-end. This
works well and I was able to enter data in the template
and save it as both "XLS" file and a record in the MS
Access database.

However, when writing a code to autmatically save the data
in the same manner, the program just saved XLS file but
didn't even prompt for "saving to database" options. As a
result there's no record created in the MS Access
database:)

Here's my code...

ActiveWorkbook.SaveAs Filename:="C:\Test.xls", _
FileFormat:=xlNormal, Password:="",
WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

Anyone has any idea what's wrong with this and how to fix
this problem? Any help is much appreciated.

Thanks in advance,
Pam
 
Pam

After your SaveAs line, put this line

Application.Run "Commit"

That will bring up the dialog that asks whether to save a new record.
 
I just tried what Dick suggested and it works
magically...I wonder what's the "commit", a built-in macro?
Thx much,
Pam
 
Back
Top