How do you make access not save "dynamically"?

O

Officeperson

I want to build a database with access but the dynamic saving feature is like
a ticking time bomb for me. It is a matter of if rather than when that I will
destroy my database unwttingly. I understand that I could save a backup, but
since everyone of the hundreds of softwares I've used in the past act
differently it is a matter of time before I unconsciously do not.
 
W

Wayne Morgan

You could use the BeforeUpdate event of a form to ask if you want to save
changes. Cancel the update if you don't.
 
A

Albert D. Kallal

I want to build a database with access but the dynamic saving feature is
like
a ticking time bomb for me. It is a matter of if rather than when that I
will
destroy my database unwttingly. I understand that I could save a backup,
but
since everyone of the hundreds of softwares I've used in the past act
differently it is a matter of time before I unconsciously do not.

Actually, there is amazing amount of systems in place that do implied saves
for you. For example, take outlook express. When you create a email and
send, in fact the email is first saved to the outbox. You are not prompted
in this case. (after all, it would be silly to be asked to save after it is
clear that the user already hit send. It is much like car, where you turn
the key, and the up pops a box, asking - do you want to start the car?

And, even in product like outlook, if you create a "note", and close it..it
actually gets saved..and again no prompts....

And, the wildly successful (and easy) to use palm pda's also have implied
saves.

And, just the act of placing, or moving a icon on your desktop also saves
the position of the icon to disk for you (should we annoy the user and
prompt in that case?).

The main difference here is that products like word, or excel are document
orientated..and not data orientated (and, to be fair, products like word
does in fact have a autosave!).

A user working in excel editing one row of data does not think that moving
to the next row should cause a save. However, when you present the data as a
grid from a database..then moving via the cursor does cause a save. The
difference here is one system is a document, and the other is a data
management system. FoxPro, Dbase, DataEase, Filermaker, Knowledge man, alpha
5 etc all in fact use implied saves (I am hard pressed to find any database
product that actually prompts for a save due to record navigation). Heck
even the tools for sql-server also use implied saves.

Once again, if a user is moving to the next record...then I can't imagine
why they would not want to save? (there might be the exception..but then why
torture the rest of the world for these exception).

So, the above is not a big deal..but virtually all database products I used
have implied saves..and just like turning the key on a car..it is the users
actions that dictate what happens.

However, while the issue of implied saves can be debated, and we can perhaps
disagree in this issue..users should in fact have a undo-command.

You can easily implement a save dialog in a ms-access form. However, if you
are going to use a sub-form, THEN YOU CAN NOT do this!! The reason for this
is that ms-access uses bound forms, and the instant you move the cursor (or
click via the mouse) to a sub-form,t he main form record is SAVED to disk.
The reason for this is simple:

You can't add child records to a table without first having saved the
parent record.

So, if your application will not use any sub-forms, then y ou can implement
a save dialog into your application..but if you going to use sub-forms,
then this whole concept breaks down. The only solution is to make a copy of
the main form data, and a copy of the sub-form data..and let the user edit
that data..and then sent it back to the table (this is messy...but about
only reasonable option you have).

You might have to re-consider your desing, and adopt the impled save that so
much of the software you use already does..
 
S

Steve Huff

If you don't want the forms to save automatically don't bound them. Write
code to do it yourself on your own terms.

--Steve Huff
 
J

Jim Craggs

I had a similar problem. My solution may not be elegant but it works.
It is better if your database is split into front end and back end. The
latter contains the data, and the former any forms queries etc. You link the
front end database to tables in the back end db. There is plenty of advice
on this MB on how to do this.

My solution, and I can see many potential pitfalls, involves creating a
replica of the back end table/tables on the front end db. Input forms use
these "temporary" tables. Once you are satisfied that the information is not
going to cause any problems in your back end db, you run a procedure which
appends the data to the back end tables and deletes it from the front end
tables. It is possible to introduce checks in the procedure to ensure that
the information is compliant.

like I said, not elegant.
 
S

Steve Huff

BE warned - using replication can create all sorts of headaches of it's
own --- I think he was simply not wanting to automatically save back to the
table, which can be controlled by using an unbound form.

--Steve Huff
 
J

Jim Craggs

I understand there are potential problems. I use this process to allow
individuals to complete timesheet information. This is filled in daily, but,
only when a full week has been completed is it sent to the main db. The user
has a database on their machine with a table which collects the daily time
information. When the timesheet is complete a procedure is run which makes
various checks for validity, sums the daily hours against each task, appends
the information to the main database, which is on a server, and empties the
daily time information from the users table. Replication is not involved. If
the intention is to wait until a packet of information has been reviewed
before the database is updated, then this works.

The code involved, which uses saved queries, is as follows


Private Sub Command38_Click()
On Error GoTo Err_Command38_Click
If Me!Text5 < 40 Then
MsgBox ("The number of hours is less than 40, Review your timesheet")
DoCmd.Close
GoTo Exit_Command38_Click
Else: MsgBox ("This is OK, Database will be updated")

DoCmd.SetWarnings False
stDocName = "qryAppendCompletedTimesheet"
DoCmd.OpenQuery stDocName, acNormal, acEdit
'appends to main database
On Error GoTo Err_Command38_Click
stDocName = "qryBackupTimesheet"
DoCmd.OpenQuery stDocName, acNormal, acEdit
'appends to record table on users' machines
On Error GoTo Err_Command38_Click
stDocName = "qryClearTempHoursTable"
DoCmd.OpenQuery stDocName, acNormal, acEdit
'clears timesheet table ready for next week
MsgBox ("If you have not had any error Messages your timesheet has been
sent to the Server")
DoCmd.SetWarnings True
End If

Exit_Command38_Click:
Exit Sub

Err_Command38_Click:
MsgBox Err.Description
Resume Exit_Command38_Click
 
Top