Re: same old "Data has been changed error message", way around this?



DoCmd.Save won't work. That does not save the record: it only saves any
design changes to the form.

To save the record in the form, try:
If Me.Dirty Then Me.Dirty = False
This works even if the form does not have focus.

Do that explicitly before anything the requires an implicit save, such as
executing an Update query on the same data, opening a report, closing the
form, closing the database, finding or moving to another record, setting the
form's Filter or OrderBy or RecordSource, and so on.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Plink" <u22902@uwe> wrote in message news:619c1366d368c@xxxxxx
HI...

Can I impose for another problem? If I can get this licked, my first
database
is done and dusted!

Ill fill you in. Im searching for records, viewing results in a listbox,
and
populating reports from the listbox on one page. The user experience is
like
this:

-Open database, search fields are empty, listbox is populated with every
record.
-Wants to do a search of records, fills in search fields which populates
listbox with matching records.
-Wants to run a report of only SOME of the matching records, clicks on
relevant records individually, hits report buttons.
-Wants to do a new search, hits Refresh button.
ETC.

Ive probably constructed it wrong, but here is my solution: (All records
have
a PrintY_N field)

-Open database, all records are switched to Print= True
-On Searching, only matching records are Print=True
-On selecting SOME matching records , all records are switched to
Print=False,
and selected records only switched back to Print=True.
ETC.

I hope you get the general idea of my methods. It runs perfectly well,
quite
happy with the solution, but of course what happens is if I mess about
with
the search sequences etc, I get the message we're all familiar with "Data
has
been changed by another user" . it doesn't throw any problems except it
forces the user to reselect some records. Ideally I would just switch this
message off completely, is this possible? Ive been trying to add a
docmd.save
in before updates and after updates and stuff, but nothing doing.

..........help?
You


.