adp form save\update problems

  • Thread starter Thread starter vegathena
  • Start date Start date
V

vegathena

I have inherited several mdb and adp front ends that work with a SQL
Server backend.

I need to get a form from an mdb to work in an adp.
The properties for the MDB form are as follows:
record source: table
data entry: no
recordset type: Dynaset

The properties for the ADP form are as follows:
record source: table
data entry: no
recordset type: updatable snapshot

So while the mdb has a dynaset recordset type, the adp has an
updatable snapshot recordset type.

The problem is that unlike the mdb form where a record is inserted/
updated whenever cmdSave is clicked (DoCmd.DoMenuItem acFormBar,
acRecordsMenu, acSaveRecord, , acMenuVer70),
the adp form updatable snapshot recordset type is inserting or
upddating a record whenever I change a field that's tied to the table.

I have tried both types of recordset type for the adp form:
snapshot doesn't allow changes
updatable snapshot changes/inserts record every time I modify any
field tied to the table

How can i get this adp form to save or update only when I tell it to
rather than every time something
is modified?

Thanks for your help.
 
As far as I know, an ADP shouldn't save the data on the form until you
switch to another record or you explicitly click save, just like an MDB.
I've been using an ADP for a couple of years now and haven't had that problem.

Is there anything else unusual about the form that you can think of? (Using
tabs, sub-forms, etc., for instance, might trigger a save.)


Rob
 
Thanks Rob.

I had that problem when I was moving from form view to design view. It
would automatically save or update the record. Also, I noticed that
the form was constantly loading with a record from the table when I
would load it directly (as opposed to loading it with a key from a
menu).
I will make sure to be more careful with these things during
development.
 
It sounds like there might be some VBA code behind the form.

Did you copy the form from a .MDB file and save it in the .ADP? If
so, the VBA code behind the form probably came with it. This could
cause a cmdSave method to run.

Another option is to run the form with unbound controls rather than as
a bound recordset. Of course this requires quite a bit more
programming. Running the form this way would give you control over
when the cmdSave method occurs.

~ Nathan
 
Back
Top