Forcing to save in Form

J

jokobe

hi ng,
the following problem occurs to me:
In a form I'm inserting data in one column, then jump to
the next column. I want to write the changes to the
database when leaving the first column and tried:

domd.save acquery "my_query"

My form is based on my_query and the debugger is throwing
an error like "the query isn't opened". Guess my code is
missing something - any helpful hints?

Thanks in advance

jokobe
 
A

Allen Browne

In the AfterUpdate event procedure of your control, set the form's Dirty
property to no:
Me.Dirty = False
 
J

jokobe

hi Allen,

thanks for the pretty fast answer. I have tried Me.Dirty,
and it was working fine, when inserted in the first column

But I have three columns, and I could get it working with
the second column (even tried to use Me.Dirty in the Form
afterupdate event), always received a system message:
"Cannot save due to conflict with a validity rule."
(sorry, but this is a pretty raw translation)
This can't be, because the form is saving properly without
a Me.Dirty. Any helpful hint left?


Joachim
 
A

Allen Browne

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.
 
A

Allen Browne

You cannot set save the record if you have a Required field that is not
filled in, or a validation rule that is not met, etc.

So, if the 2nd field is required, then trying to force a save after the
first field is entered cannot succeed while the 2nd one is still blank.

When the form's AfterUpdate event fires, the record is already saved, so you
do not need to save it again then.
 

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