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

Database properties

P: n/a
I wish to control which users can and cannot alter the toolbars. The
opening popup window invites them to login. Immediately after this, I
have the code:

CurrentDb.Properties("AllowToolbarChanges") = isManager
CurrentDb.Properties.Refresh

isManager is a function that returns true/false

This works (up to a point) but I am caught by the final line in the
Help that says:
"This property's setting doesn't take effect until the next time the
database opens"

So, it would seem that I have to quit the database and get the user to
log in again. (But then, of course, not repeat this procedure!)

Is there any way in which this change can be made for the current user
without them having to log in again?

Or is it possible to quit and then (from code) automatically log that
user in again?
Jul 29 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
I execute that type of code on the copy used to update the end-user's
front-end. That way they have the settings on the 1st login.

"Jim Devenish" <in***************@foobox.comwrote in message
news:91**********************************@c58g2000 hsc.googlegroups.com...
I wish to control which users can and cannot alter the toolbars. The
opening popup window invites them to login. Immediately after this, I
have the code:

CurrentDb.Properties("AllowToolbarChanges") = isManager
CurrentDb.Properties.Refresh

isManager is a function that returns true/false

This works (up to a point) but I am caught by the final line in the
Help that says:
"This property's setting doesn't take effect until the next time the
database opens"

So, it would seem that I have to quit the database and get the user to
log in again. (But then, of course, not repeat this procedure!)

Is there any way in which this change can be made for the current user
without them having to log in again?

Or is it possible to quit and then (from code) automatically log that
user in again?

Jul 29 '08 #2

P: n/a
On Jul 29, 1:10*pm, "paii, Ron" <n...@no.comwrote:
I execute that type of code on the copy used to update the end-user's
front-end. That way they have the settings on the 1st login.

"Jim Devenish" <internet.shopp...@foobox.comwrote in message

news:91**********************************@c58g2000 hsc.googlegroups.com...
I wish to control which users can and cannot alter the toolbars. *The
opening popup window invites them to login. *Immediately after this, I
have the code:
CurrentDb.Properties("AllowToolbarChanges") = isManager
CurrentDb.Properties.Refresh
isManager is a function that returns true/false
This works (up to a point) but I am caught by the final line in the
Help that says:
"This property's setting doesn't take effect until the next time the
database opens"
So, it would seem that I have to quit the database and get the user to
log in again. (But then, of course, not repeat this procedure!)
Is there any way in which this change can be made for the current user
without them having to log in again?
Or is it possible to quit and then (from code) automatically log that
user in again?
But this assumes that a particular front-end (on a specific machine)
is only used by one user. This is not the case here. Different users
may, from time to time, log in to a specific front-end. I want to
have the behaviour different for each user - not for each front-end.

Jim

Jul 29 '08 #3

P: n/a
"Jim Devenish" <in***************@foobox.comwrote in message
news:91**********************************@c58g2000 hsc.googlegroups.com...
>I wish to control which users can and cannot alter the toolbars. The
opening popup window invites them to login. Immediately after this, I
have the code:

CurrentDb.Properties("AllowToolbarChanges") = isManager
CurrentDb.Properties.Refresh

isManager is a function that returns true/false

This works (up to a point) but I am caught by the final line in the
Help that says:
"This property's setting doesn't take effect until the next time the
database opens"
Well it's a start-up option so that makes sense. Is it worth considering a
"manager's" toolbar requirements and providing them on custom toolbars?

Regards,
Keith.
www.keithwilby.com

Jul 29 '08 #4

P: n/a
"Jim Devenish" <in***************@foobox.comwrote in message
news:91**********************************@c58g2000 hsc.googlegroups.com...
>I wish to control which users can and cannot alter the toolbars. The
opening popup window invites them to login. Immediately after this, I
have the code:

CurrentDb.Properties("AllowToolbarChanges") = isManager
CurrentDb.Properties.Refresh

isManager is a function that returns true/false

This works (up to a point) but I am caught by the final line in the
Help that says:
"This property's setting doesn't take effect until the next time the
database opens"

So, it would seem that I have to quit the database and get the user to
log in again. (But then, of course, not repeat this procedure!)

Is there any way in which this change can be made for the current user
without them having to log in again?

Or is it possible to quit and then (from code) automatically log that
user in again?
You can't just set a custom object property without first creating it.
Here's a module which will give you the ability to set, get and delete
object properties:

http://www.smccall.demon.co.uk/Objects.htm#ObjFuncs

Using that, all you need is:

SetObjProp CurrentDb, "AllowToolbarChanges", True

then, to verify it:

Debug.Print GetObjProp(CurrentDb, "AllowToolbarChanges", false)
Result: True

Notice that the line in help that you mentioned is *wrong*. As soon as you
either create or alter an object's properties, the changes are made
available. They will survive a database restart, though.

Also if you're going to refresh the properties collection (I've never found
it to be necessary), you're better off doing it before the assignment rather
than afterward.
Jul 29 '08 #5

P: n/a
On Jul 29, 2:56*pm, "Stuart McCall" <smcc...@myunrealbox.comwrote:
"Jim Devenish" <internet.shopp...@foobox.comwrote in message

news:91**********************************@c58g2000 hsc.googlegroups.com...
I wish to control which users can and cannot alter the toolbars. *The
opening popup window invites them to login. *Immediately after this, I
have the code:
CurrentDb.Properties("AllowToolbarChanges") = isManager
CurrentDb.Properties.Refresh
isManager is a function that returns true/false
This works (up to a point) but I am caught by the final line in the
Help that says:
"This property's setting doesn't take effect until the next time the
database opens"
So, it would seem that I have to quit the database and get the user to
log in again. (But then, of course, not repeat this procedure!)
Is there any way in which this change can be made for the current user
without them having to log in again?
Or is it possible to quit and then (from code) automatically log that
user in again?

You can't just set a custom object property without first creating it.
Here's a module which will give you the ability to set, get and delete
object properties:

http://www.smccall.demon.co.uk/Objects.htm#ObjFuncs

Using that, all you need is:

SetObjProp CurrentDb, "AllowToolbarChanges", True

then, to verify it:

Debug.Print GetObjProp(CurrentDb, "AllowToolbarChanges", false)
Result: True

Notice that the line in help that you mentioned is *wrong*. As soon as you
either create or alter an object's properties, the changes are made
available. They will survive a database restart, though.

Also if you're going to refresh the properties collection (I've never found
it to be necessary), you're better off doing it before the assignment rather
than afterward.
Thanks Stuart but this still does not work for me. I still need to
close and open the database for it to take effect. It would seem that
the line in the Help in correct.

When AllowToolbarChanges is set to false (after a restart) the
Toolbars item in the View menu is not available. When I run your
code, this item remains visible until I restart the database. I want
it to take effect immediately
Jul 29 '08 #6

P: n/a
Thanks Stuart but this still does not work for me. I still need to
close and open the database for it to take effect. It would seem that
the line in the Help in correct.
When AllowToolbarChanges is set to false (after a restart) the
Toolbars item in the View menu is not available. When I run your
code, this item remains visible until I restart the database. I want
it to take effect immediately
Ah. Ok, try this:

CommandBars("Menu Bar").Controls("View").Controls("Toolbars").Visibl e =
False

(that should be all on one line)
Jul 29 '08 #7

P: n/a
On Jul 29, 4:02*pm, "Stuart McCall" <smcc...@myunrealbox.comwrote:
Thanks Stuart but this still does not work for me. *I still need to
close and open the database for it to take effect. *It would seem that
the line in the Help in correct.
When AllowToolbarChanges is set to false (after a restart) the
Toolbars item in the View menu is not available. *When I run your
code, this item remains visible until I restart the database. *I want
it to take effect immediately

Ah. Ok, try this:

CommandBars("Menu Bar").Controls("View").Controls("Toolbars").Visibl e =
False

(that should be all on one line)
That did the trick, thanks.

I was not sure of the syntax to do this.

Jim

Jul 29 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.