ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Updating database worksheet problem (Template Wizard) (https://www.excelbanter.com/excel-discussion-misc-queries/1718-updating-database-worksheet-problem-template-wizard.html)

grasping@straws

Updating database worksheet problem (Template Wizard)
 
Got my template for setting up client jobs info all made up & linked
(via Template Wizard setup) to a database worksheet (Excel 97) for
summaries of various stuff - start dates/employee responsible/etc.

So - I open my template & fill in the starting info; then do a "Save
As" ClientsName.xls - when I do this save, I know the database
worksheet opens in the background (I tested this by trying a
messagebox @ the "Workbook_Open" event) - in fact it seems to open
twice - but the first time I save, and even when I close the book & am
prompted to save again, there is no prompt to "Save to a new record"
or "Update existing record".

After I close the newly-saved workbook, then reopen it and save again
I get the prompt, but this is a pain for the other folks using this
setup (most of whom are barely computer literate; it's this bunch I've
been setting this up for, trying to make it as simple/automated as
possible). Shouldn't have to open it twice to get it to work!

If I'm correct,this "New record/update record" prompt & messagebox has
to be an Application-level event, no? I can't seem to trap it in
either Workbook...what I'm looking for is the syntax & event names (I
guess) to include in a Macro that'll FORCE the prompt at the first
save of the new workbook.....TIA to any who can help.

tm



grasping@straws

Okay, so after hours of Googling & drilling down through countless
Messageboard posts/replies, I've come up with something that works; it
ain't pretty, not as elegant as I'd like, but it works, so here it is
(in case someone else runs into the same problem):

Application.Run "WZTEMPLT.XLA!Commit"

This takes a while to run - it fires the .xla in the background, as
well as opening the database Workbook - but it DOES force the "Add
Record" or "Update Record" messagebox on the FIRST save-as from my
Template workbook.

tm



All times are GMT +1. The time now is 12:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com