Force Save? *** Urgent help***

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have form with before and after update events. But in one case I would like
to
force save just one field prefereably. If that isn't possible I will have to
resort to saving everything. How can it be done?

Thank you,
-Me
 
Me said:
I have form with before and after update events. But in one case I
would like to
force save just one field prefereably. If that isn't possible I will
have to resort to saving everything. How can it be done?

Thank you,
-Me

You can't (at least not with a bound form). Well, before I say "can't" off
the top of my head I suppose you could place all changes so far into
variables, issue an undo on the form so the record is no longer dirty, use
an update query to save the one field into the underlying record, save the
PK into another variable, requery the form, use the stored PK to position
yourself back at the same record, then use the other variables to re-apply
all of the changes to the other fields.

Now, since nobody else has ever needed to do such a thing, can you explain
why you think you need to? Chances are your actual "need" can be satisfied
in a more conventional manner.
 
You'll have to save all the fields in the form, with a bound form all the
fields will be saved together.

You can use this code to save the record

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
 
Hi Rick,

First of all thank you very much for the reply!

You have a valid point why do I need it.
I am sure this is nothing unusual, its just that others may have designed it
differently.

I have master table in which I plan to store the initial amount. Then in
detail tables, the value of amount changes, so at any point in time users
would like to know the final amount. The other way we could do is every time
a user queries, do the math and display amount. I wanted to avoid doing
calculations during search and instead, at the time of data entry store the
final amount in master record.

Now its debatable one may call it stupid design. But I think this way the
performance will be better.

What's your opinion? Do you have other suggestions?

Thanks again for your time.
-Me
 
Hi Ofter,

Thank you, I will try it out.

-Me

Ofer Cohen said:
You'll have to save all the fields in the form, with a bound form all the
fields will be saved together.

You can use this code to save the record

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
 
Me said:
Hi Rick,

First of all thank you very much for the reply!

You have a valid point why do I need it.
I am sure this is nothing unusual, its just that others may have
designed it differently.

I have master table in which I plan to store the initial amount. Then
in detail tables, the value of amount changes, so at any point in
time users would like to know the final amount. The other way we
could do is every time a user queries, do the math and display
amount. I wanted to avoid doing calculations during search and
instead, at the time of data entry store the final amount in master
record.

Now its debatable one may call it stupid design. But I think this way
the performance will be better.

What's your opinion? Do you have other suggestions?

Thanks again for your time.
-Me

I still don't see what this has to do with saving one field to the tabel
while still working on a record. The field that affects the stored value
should not be included in that total until the (whole) record is saved.
What if the user decides to not finish the record? What if they decide
after you have done the "one field save" that the amount they entered was
wrong? How are you going to reconcile the new amount entered after having
already updated the total with the previous value?
 
Back
Top