open the table object by code only (1 Viewer)

AccessProgram

Registered User.
Local time
Today, 02:21
Joined
Dec 7, 2009
Messages
68
Thank God I found a forum such as this, I never thought there would exist a forum like this.

Good day everybody, I am not new to access programming but I have questions regarding it. Please help me out here guys.

Basically I am looking if there is such a code that will only allow users to open the table object and query objects through VBA. I would like to disallow the users to open it just by clicking the mouse or pressing enter on the keyboard.
 

John Big Booty

AWF VIP
Local time
Today, 19:21
Joined
Aug 29, 2005
Messages
8,263
Firstly Welcome to the forum.

Good DB design dictates that the user not be given direct access to the Table Object, all interactions with the table and it's data should be carried out through a form. Likewise, I can conceive of no situation were the user should be allowed direct access to a query.

Perhaps, if you outline what you want to achieve an alternate solution can be suggested.
 

ajetrumpet

Banned
Local time
Today, 04:21
Joined
Jun 22, 2007
Messages
5,638
Basically I am looking if there is such a code that will only allow users to open the table object and query objects through VBA. I would like to disallow the users to open it just by clicking the mouse or pressing enter on the keyboard.

if you ever get there, study tabledefs and querydef objects. they are what you open. but to go along with what john said, users shouldn't be doing either of these things, as already said. and if you want to know the truth about it, access was not designed for people (users OR programmers) to be doing this sort of stuff.

I have not run into a single situation yet that makes a need for something like this, but I could be wrong. I've done it a million times, but only when I'm playing around.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 10:21
Joined
Sep 12, 2006
Messages
15,696
The reason is that when you manipulate data through forms, you can control and manage the input - validate the sense of data, conceal certain details of information, and so forth.

if you use the table/query directly then you lose all this control.

---------
I do popup queries directly, but generally in situations where the user needs to see some information, and its easier to open the query, rather than design a form based on the query - especially where the user may then want to save the query into Excel, perhaps. However, generally I will open the uqery as a snapshot, so it becomes non-editable, for the same reason.
 

AccessProgram

Registered User.
Local time
Today, 02:21
Joined
Dec 7, 2009
Messages
68
Thanks for welcoming me here.

Yes guys, you are all correct that users should only be dealing with forms when interacting with the table data or query data.

As of the moment, I am just curious if that can be done because I am playing and experimenting with Access to be able to how things can be done with it.

Say Adam, when can I possibly search for a good reference on tabledef and querydef?
 

ajetrumpet

Banned
Local time
Today, 04:21
Joined
Jun 22, 2007
Messages
5,638
Say Adam, when can I possibly search for a good reference on tabledef and querydef?

you probably won't find them because they are used very rarely. you can read about them and stuff by google searches, but that will only get you various pieces of knowledge. the best thing to do is probably learn from someone that knows how Access is assembled as they would know the layering of the objects and stuff.
 

Zaeed

Registered Annoyance
Local time
Today, 19:21
Joined
Dec 12, 2007
Messages
383
Are you saying you don't want them to have access to the objects window? (the list of all the tables, queries, forms etc)
 

AccessProgram

Registered User.
Local time
Today, 02:21
Joined
Dec 7, 2009
Messages
68
you probably won't find them because they are used very rarely. you can read about them and stuff by google searches, but that will only get you various pieces of knowledge. the best thing to do is probably learn from someone that knows how Access is assembled as they would know the layering of the objects and stuff.


You are right Adam, I googled it but only pieces of knowledge can be found. I would like to take you advice to learn from someone but I dont know who's someone I would asked from? Can you probably tell me the right person whom I can ask to?
 

AccessProgram

Registered User.
Local time
Today, 02:21
Joined
Dec 7, 2009
Messages
68
Are you saying you don't want them to have access to the objects window? (the list of all the tables, queries, forms etc)

To rephrase my question, yes I dont want them to have access to the objects windows as you have said. Do you have idea to it on how to do it through VBA ?
 

ajetrumpet

Banned
Local time
Today, 04:21
Joined
Jun 22, 2007
Messages
5,638
You are right Adam, I googled it but only pieces of knowledge can be found. I would like to take you advice to learn from someone but I dont know who's someone I would asked from? Can you probably tell me the right person whom I can ask to?
i have no idea who you can ask, but if you're restatement of the question below is correct, than you're probably going to get an answer real quick.

If you want more info on actual object containers like definitions, i'd start a new thread and ask about it. you'll get a lot of response I would guess.

You can certainly ask me, but I've only got 10 years or so in with this stupid program. :D
 

Zaeed

Registered Annoyance
Local time
Today, 19:21
Joined
Dec 12, 2007
Messages
383
Tools -> Startup, untick Show Database Window..

Search the forums for the method to disable the Shift Key
 

AccessProgram

Registered User.
Local time
Today, 02:21
Joined
Dec 7, 2009
Messages
68
I have change my topic question to "No Access to Objects Window" Adam.

Zaeed thanks for the reply. I was thinking if I can disable the access to objects windows even when the database window is shown.
 

Zaeed

Registered Annoyance
Local time
Today, 19:21
Joined
Dec 12, 2007
Messages
383
I have change my topic question to "No Access to Objects Window" Adam.

Zaeed thanks for the reply. I was thinking if I can disable the access to objects windows even when the database window is shown.

Huh? You want to be able to see it but not click it??
 

AccessProgram

Registered User.
Local time
Today, 02:21
Joined
Dec 7, 2009
Messages
68
Yes. the objects can be seen but if clicked to open, it should not open for it is disabled through vba.

I am using 2007 version and using DoCmd.LockNavigationPane True will disable the user from deleting all objects in the navigation pane. So maybe there is also vba code that will disable opening it.
 

Zaeed

Registered Annoyance
Local time
Today, 19:21
Joined
Dec 12, 2007
Messages
383
I'm unsure about this one sorry..

Can I ask why you're trying to do this?
 

AccessProgram

Registered User.
Local time
Today, 02:21
Joined
Dec 7, 2009
Messages
68
I see. I think I should gather more information from the internet to find way for this workaround?
 

Users who are viewing this thread

Top Bottom