"Baldy" <Jo**@smith.com> wrote in message
news:41**********@news.adelaide.pipenetworks.com.. .
Hi folks.
I have a query opened from a menu bar. Is it possible to make the query
read only?
Thanks
Al
From a menu bar? If this a menu you designed and you wrote the code to open
the query, you could use something like this:
Docmd.OpenQuery "qryMyQuery",acViewNormal,acReadOnly
Alternatively you could change the design of the query so it is always
read-only by, for example, adding DISTINCT after the SELECT key word:
SELECT DISTINCT ID, Field1, Field2 FROM MyTable
Another alternative would be to open a form in datasheet view which is bound
to the query, instead of opening a query directly. This gives you lots more
flexibility since as well as the basic AllowEdits, AllowAdditions,
AllowDeletions properties of the form, you can lock or unlock, enable or
disable individual controls. You also can write any amount of code to react
to the form's events.