Form number/filename incrementing problem

C

cdub

Hi, I have a form that uses a text file to keep track of the form number
automatically inserted in a form field. Then, when the user clicks on the SAVE
and Print button, it saves it with the standard name and form number and prints
it. It works pretty well except:

1. Some users refuse to click the SAVE and PRINT button and use the toolbar to
print, save and exit. The number in the text file is incremented but there is
no matching document in the designated file folder.

2. The form is incremented before it is saved so if a user changes their mind
and exits the form, the text file is still incremented and there is no
corresponding file in the file folder.

I need to cause the number in the text file to be incremented only if the user
uses the SAVE and Print button and force the user to use the SAVE and Print
button instead of the toolbar.

I'm only trying to edit this form and do not know much VBA at all. Any help
would be appreciated.

Thanks,
Connie
 
J

Jezebel

The usual approach to this is to use a dedicated template. In the template,
write macros called FileSave and FileSaveAs -- these will run in place of
the built-in functions. If the form is being saved for the first time,
increment the form number and save it to the log file (presumably you want
to update the form number log only the first time the form is saved).

You can also intercept the print command by writing macros called FilePrint
and FilePrintDefault -- it might be sufficient to require that tthe document
has been saved at least once (ie the form number is valid) before allowing
it to be printed.

Before you start writing any code at all, think through -- and write out --
the logic of what's actually going to happen. Every minute of planning saves
you ten minutes of coding.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top