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

Open Access Options without displaying database window

P: n/a
I have a command to open the Access Options dialogue from code:

DoCmd.RunCommand acCmdOptions

It also opens the Database Window behind it. Is it possible to open the
Options without having the database window open as well?

dixie
Nov 13 '05 #1
Share this Question
Share on Google+
15 Replies


P: n/a
Do you really need to open the database options dialog?

The above sounds like a rather strange need.

You can certainly control a lot of options via code. Perhaps you might just
create a un-bound form, and build you open custom options form?

I would as rule stay away from having "users" to setup options, usually you
can set things up before hand. I would be quite nervous about opening the
database options and exposing so many features to my users. A good portion
of those options are quite advanced, and no end user has any business
messing with that stuff..
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.attcanada.net/~kallal.msn
Nov 13 '05 #2

P: n/a
The thing I want to achieve is to allow the setting of Confirm Action
Queries to false. If I can achieve this in code, that is a much better
solution. How can it be done?

dixie

"Albert D. Kallal" <Pl*******************@msn.com> wrote in message
news:qpztc.605434$oR5.274777@pd7tw3no...
Do you really need to open the database options dialog?

The above sounds like a rather strange need.

You can certainly control a lot of options via code. Perhaps you might just create a un-bound form, and build you open custom options form?

I would as rule stay away from having "users" to setup options, usually you can set things up before hand. I would be quite nervous about opening the
database options and exposing so many features to my users. A good portion
of those options are quite advanced, and no end user has any business
messing with that stuff..
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.attcanada.net/~kallal.msn

Nov 13 '05 #3

P: n/a
Dixie, you can to warnings of via code, but you must make sure to turn them
back on via code or warnings you may want to see will not show up.

Private Sub cmdMyButton_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryMyActionQuery", acNormal, acEdit
DoCmd.SetWarnings True
End Sub
--
Reggie

www.smittysinet.com
----------
"dixie" <di****@dogmail.com> wrote in message
news:uC****************@nnrp1.ozemail.com.au...
The thing I want to achieve is to allow the setting of Confirm Action
Queries to false. If I can achieve this in code, that is a much better
solution. How can it be done?

dixie

"Albert D. Kallal" <Pl*******************@msn.com> wrote in message
news:qpztc.605434$oR5.274777@pd7tw3no...
Do you really need to open the database options dialog?

The above sounds like a rather strange need.

You can certainly control a lot of options via code. Perhaps you might

just
create a un-bound form, and build you open custom options form?

I would as rule stay away from having "users" to setup options, usually

you
can set things up before hand. I would be quite nervous about opening the database options and exposing so many features to my users. A good portion of those options are quite advanced, and no end user has any business
messing with that stuff..
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.attcanada.net/~kallal.msn


Nov 13 '05 #4

P: n/a
I know I can do this Reggie, but I was looking for a way to turn off the
Action Query Confirmation only at the start of my program opening, as I
don't want it activated at any time. I do however wish to confirm Record
Changes and Document deletions.

The program runs on a remote site and they have their Confirm Action Queries
True by default. I just thought that if I could get it turned off in code,
it would circumvent the problem of having to turn warnings on and off every
time an action query runs.

dixie

"Reggie" <no**********@smittysinet.com> wrote in message
news:iN********************@comcast.com...
Dixie, you can to warnings of via code, but you must make sure to turn them back on via code or warnings you may want to see will not show up.

Private Sub cmdMyButton_Click()
DoCmd.SetWarnings False
DoCmd.OpenQuery "qryMyActionQuery", acNormal, acEdit
DoCmd.SetWarnings True
End Sub
--
Reggie

www.smittysinet.com
----------
"dixie" <di****@dogmail.com> wrote in message
news:uC****************@nnrp1.ozemail.com.au...
The thing I want to achieve is to allow the setting of Confirm Action
Queries to false. If I can achieve this in code, that is a much better
solution. How can it be done?

dixie

"Albert D. Kallal" <Pl*******************@msn.com> wrote in message
news:qpztc.605434$oR5.274777@pd7tw3no...
Do you really need to open the database options dialog?

The above sounds like a rather strange need.

You can certainly control a lot of options via code. Perhaps you might

just
create a un-bound form, and build you open custom options form?

I would as rule stay away from having "users" to setup options,
usually
you
can set things up before hand. I would be quite nervous about opening

the database options and exposing so many features to my users. A good portion of those options are quite advanced, and no end user has any business
messing with that stuff..
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.attcanada.net/~kallal.msn



Nov 13 '05 #5

P: n/a
"dixie" <di****@dogmail.com> wrote in message
news:uJ****************@nnrp1.ozemail.com.au...
I know I can do this Reggie, but I was looking for a way to turn off the
Action Query Confirmation only at the start of my program opening, as I
don't want it activated at any time. I do however wish to confirm Record
Changes and Document deletions.

The program runs on a remote site and they have their Confirm Action Queries
True by default. I just thought that if I could get it turned off in code,
it would circumvent the problem of having to turn warnings on and off every
time an action query runs.


Do these people use no other Access apps besides yours? What your proposing
would turn off confirmations for all apps which could very well NOT be
appreciated by those users. It is fine to make *your* app run the way you want,
but don't mess with global user settings.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #6

P: n/a
Hi Dixie,

If you can live with running these action queries from a form, rather than
executing them from the database window directly...
I'd suggest using the .Execute Method as below. There are no confirmation
messages nor any risk of leaving "SetWarnings = False" using this method.
----------------------------------------------------------------------------
----------
There are at least a couple of ways to implement this ... (Modifying
Reggie's code here)

1.) Run a saved action query
-----------------------------
********************************************
Private Sub cmdMyButton_Click()

Dim MyDB As DAO.Database
Set MyDB = CurrentDb

MyDB.Execute "qryMyActionQuery", dbFailOnError
Set MyDB = Nothing

End Sub
********************************************

OR

2.) Build an SQL string in the code directly, and avoid having to even
*have* a saved query.
This is my personal preference, as there is no chance that someone will
accidentally run this query without understanding the consequences.

-- Of course you'll have to modify the "MySQL" string below to match the SQL
from your present query --
(Open your saved query in SQL view, then copy and paste it into the code
window for modifications.)
-----------------------------------------------------------
********************************************
Private Sub cmdMyButton_Click()

Dim MyDB As DAO.Database
Set MyDB = CurrentDb
Dim MySQL as String

MySQL = ""
MySQL = MySQL & "UPDATE tblPartsInventory SET "
MySQL = MySQL & "tblPartsInventory.Selected = False "
MySQL = MySQL & "WHERE (((tblPartsInventory.Selected)=True));"

MyDB.Execute MySQL, dbFailOnError
Set MyDB = Nothing

End Sub
********************************************
--
HTH,
Don
=============================
Use My*****@Telus.Net for e-mail
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)

I'm an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.

Do Until SinksIn = True
File/Save, <slam fingers in desk drawer>
Loop

================================


"dixie" <di****@dogmail.com> wrote in message
news:uJ****************@nnrp1.ozemail.com.au...
I know I can do this Reggie, but I was looking for a way to turn off the
Action Query Confirmation only at the start of my program opening, as I
don't want it activated at any time. I do however wish to confirm Record
Changes and Document deletions.

The program runs on a remote site and they have their Confirm Action Queries True by default. I just thought that if I could get it turned off in code, it would circumvent the problem of having to turn warnings on and off every time an action query runs.

dixie

< previous posts snipped> DL
Nov 13 '05 #7

P: n/a
"dixie" <di****@dogmail.com> wrote in
news:WQ****************@nnrp1.ozemail.com.au:
I have a command to open the Access Options dialogue from
code:

DoCmd.RunCommand acCmdOptions

It also opens the Database Window behind it. Is it possible
to open the Options without having the database window open as
well?

dixie

Dixie, those newbies who've responded don't know the very simple
way of turning these options off or on.

application.setoption("Confirm Action Queries",true)

Before you run it, you should store the existing setting to a
global variable, and set it back the way it was before leaving
the application.

bAction = application.getoption("Confirm Action Queries"

application.setoption("Confirm Action Queries",bAction)

One really useful value to play with is the "Behaviour Entering
Field" option. you can "Select entire field" or "go to end of
field" as the setting.

Bob Quintal

Nov 13 '05 #8

P: n/a
"Bob Quintal" <bq******@generation.net> wrote in message
news:94******************************@news.teranew s.com...
"dixie" <di****@dogmail.com> wrote in
news:WQ****************@nnrp1.ozemail.com.au:
I have a command to open the Access Options dialogue from
code:

DoCmd.RunCommand acCmdOptions

It also opens the Database Window behind it. Is it possible
to open the Options without having the database window open as
well?

dixie

Dixie, those newbies who've responded don't know the very simple
way of turning these options off or on.


Actually I think that most "non-newbies" avoid DoCmd.RunSQL and DoCmd.OpenQuery
in the first place making the warnings a non-issue.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #9

P: n/a

"Rick Brandt" <ri*********@hotmail.com> wrote...
"Bob Quintal" <bq******@generation.net> wrote...
"dixie" <di****@dogmail.com> wrote:
I have a command to open the Access Options dialogue from
code:

DoCmd.RunCommand acCmdOptions

It also opens the Database Window behind it. Is it possible
to open the Options without having the database window open as
well?
Dixie, those newbies who've responded don't know the very simple
way of turning these options off or on.
Actually I think that most "non-newbies" avoid DoCmd.RunSQL and DoCmd.OpenQuery in the first place making the warnings a non-issue.


And the "non-newbies" who do not do that use "DoCmd.SetWarnings False"
instead of changing the SetOption since the latter changes a user setting,
which is inappropriate to do without permission....
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.
Nov 13 '05 #10

P: n/a
Bob, your command:
application.setoption("Confirm Action Queries",true)
brings up a syntax error when I try to compile it. Can you see what the
problem is? This would be really nice as I can set it to false, and then
set it back at the end.

dixie

"Bob Quintal" <bq******@generation.net> wrote in message
news:94******************************@news.teranew s.com...
"dixie" <di****@dogmail.com> wrote in
news:WQ****************@nnrp1.ozemail.com.au:
I have a command to open the Access Options dialogue from
code:

DoCmd.RunCommand acCmdOptions

It also opens the Database Window behind it. Is it possible
to open the Options without having the database window open as
well?

dixie

Dixie, those newbies who've responded don't know the very simple
way of turning these options off or on.

application.setoption("Confirm Action Queries",true)

Before you run it, you should store the existing setting to a
global variable, and set it back the way it was before leaving
the application.

bAction = application.getoption("Confirm Action Queries"

application.setoption("Confirm Action Queries",bAction)

One really useful value to play with is the "Behaviour Entering
Field" option. you can "Select entire field" or "go to end of
field" as the setting.

Bob Quintal

Nov 13 '05 #11

P: n/a
"dixie" <di****@dogmail.com> wrote in
news:Rd*****************@nnrp1.ozemail.com.au:
Bob, your command:
application.setoption("Confirm Action Queries",true)
brings up a syntax error when I try to compile it. Can you
see what the problem is? This would be really nice as I can
set it to false, and then set it back at the end.

dixie

"Bob Quintal" <bq******@generation.net> wrote in message
news:94******************************@news.teranew s.com...
"dixie" <di****@dogmail.com> wrote in
news:WQ****************@nnrp1.ozemail.com.au:
> I have a command to open the Access Options dialogue from
> code:
>
> DoCmd.RunCommand acCmdOptions
>
> It also opens the Database Window behind it. Is it
> possible to open the Options without having the database
> window open as well?
>
> dixie
>
sorry, just remove the ()

Bob Quintal.
Dixie, those newbies who've responded don't know the very
simple way of turning these options off or on.

application.setoption("Confirm Action Queries",true)

Before you run it, you should store the existing setting to a
global variable, and set it back the way it was before
leaving the application.

bAction = application.getoption("Confirm Action Queries"

application.setoption("Confirm Action Queries",bAction)

One really useful value to play with is the "Behaviour
Entering Field" option. you can "Select entire field" or "go
to end of field" as the setting.

Bob Quintal



Nov 13 '05 #12

P: n/a
"Michael \(michka\) Kaplan [MS]" <mi*****@online.microsoft.com>
wrote in news:40********@news.microsoft.com:

"Rick Brandt" <ri*********@hotmail.com> wrote...
"Bob Quintal" <bq******@generation.net> wrote...
> "dixie" <di****@dogmail.com> wrote: > > I have a command to open the Access Options dialogue from
> > code:
> >
> > DoCmd.RunCommand acCmdOptions
> >
> > It also opens the Database Window behind it. Is it
> > possible to open the Options without having the database
> > window open as well? > Dixie, those newbies who've responded don't know the very
> simple way of turning these options off or on.

Actually I think that most "non-newbies" avoid DoCmd.RunSQL
and

DoCmd.OpenQuery
in the first place making the warnings a non-issue.


And the "non-newbies" who do not do that use
"DoCmd.SetWarnings False" instead of changing the SetOption
since the latter changes a user setting, which is
inappropriate to do without permission....


Michael, would you consider it appropriate for the user to alter
the state of the "Show Hidden Objects" or even worse, change the
"Default Record Locking"?

The tools->options is a jumble of user and developer switches.
AS an application's developer, I believe it's MY call as to how
the UI should behave.

But I do agree with the Docmd issues you raised.

Bob Quintal

Nov 13 '05 #13

P: n/a
Hi Dixie

What I do is the following:
---------------------------------------------------------
Public Function FRUNQUE(QryN As String)
'an internal function that is used to run queries
On error GoTo err
'--------------------------------------
DoCmd.SetWarnings False
DoCmd.OpenQuery query_name, acViewNormal, acEdit
xit:
DoCmd.SetWarnings True
Exit Function
err:
''MsgBox Error$
Resume xit
End Function

---------------------------------------------------------

I have a function that I can call from anywhere, which runs a query without
any warnings

So in any other code I can write

Call frunque("MyQuery") to run myquery or any other one for that matter
without warning messages.

---
Please immediately let us know (by phone or return email) if (a) this email
contains a virus
(b) you are not the intended recipient
(c) you consider this email to be spam.
We have done our utmost to make sure that
none of the above are applicable. THANK YOU
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.691 / Virus Database: 452 - Release Date: 26/05/2004
Nov 13 '05 #14

P: n/a
"WindAndWaves" <ac****@ngaru.com> wrote in message
news:5v********************@news.xtra.co.nz...
Hi Dixie

What I do is the following:
---------------------------------------------------------
Public Function FRUNQUE(QryN As String)
'an internal function that is used to run queries
On error GoTo err
'--------------------------------------
DoCmd.SetWarnings False
DoCmd.OpenQuery query_name, acViewNormal, acEdit
xit:
DoCmd.SetWarnings True
Exit Function
err:
''MsgBox Error$
Resume xit
End Function

---------------------------------------------------------

I have a function that I can call from anywhere, which runs a query without
any warnings

So in any other code I can write

Call frunque("MyQuery") to run myquery or any other one for that matter
without warning messages.


But were you aware that you can also use...

CurrentDB.Execute "QueryName", dbFailOnError

....and you also won't get the confirmation messages?
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


Nov 13 '05 #15

P: n/a
"Bob Quintal" <bq******@generation.net> wrote...
Michael, would you consider it appropriate for the user to alter
the state of the "Show Hidden Objects" or even worse, change the
"Default Record Locking"?
In an app you should popbably not show the show the database window.
Otherwise if you do, and THEY show hidden objects, there is no specific
reason to hide them.

As for default record locking, if you change the settings for your db then
their default setting does not change it.
The tools->options is a jumble of user and developer switches.
AS an application's developer, I believe it's MY call as to how
the UI should behave.


To some extent. But its important to try to (a) not change settings you can
avoid changing, and (b) carefully set other settings back if you change them
to minimize ngative impact.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.
Nov 13 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.