By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,911 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

making queries read only

P: n/a
Hi folks.

I have a query opened from a menu bar. Is it possible to make the query read
only?

Thanks
Al
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"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?


Set its RecordSource Type to Snapshot.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a
"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.
Nov 13 '05 #3

P: n/a
Thanks that did it,

I used distinct in the query,

I'm calling deirct to the query form the menu so I couldn't use
"acReadOnly"

thanks
Al
"Eric Schittlipz" <er**@schittlipz.com> wrote in message
news:ck**********@titan.btinternet.com...
"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.

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.