472,371 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

Open Access Options without displaying database window

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
15 6616
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
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
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
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
"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
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
"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
"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

"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
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
"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
"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
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
"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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Marcello | last post by:
Hello I have a page of 2 frame: menu (menu.php) corpo (corpo.php) In menu.php i have: <script> function selAut(){ aut=autore.selectedIndex; aut=autore.options.value;
9
by: WalterR | last post by:
This is my first time here, so there may be earlier relevant threads of which I am unaware. Though my experience with DB2 is not extensive, such as it is was under OS/390 or equ. My main...
4
by: Mike Turco | last post by:
A2003. I haven't seen this before. You use File/New to create a new database in Access and call it DB1. Close Access, click on db1, Access opens and there's nothing there. Then I try opening the...
4
by: Csaba Gabor | last post by:
Up until a few weeks ago, javascript code like window.open("http://mydomain.com", "windowName"); would always bring my new or reused window to the top, with focus. Lately, Firefox (Deer park...
9
by: semesm22 | last post by:
hello all, i am using asp.net with IIS on a Windows XP machine to open an Access database, and i know that this topic has been posted on forums hundreds of times, but i can't find an answer that...
38
by: Oldie | last post by:
I have built an MS Access Application under MS Office XP (but I also own MS Office 2000). I have split the application in the pure database tables and all the queries, forms, reports and macro's. ...
14
by: SimeonD | last post by:
Hi I have an access database called Sales.Mdb In vb.net 2005, I'd like to open it. Which I can do. What I can't figure out is how to figure out if Sales.Mdb is open already. If so, I want to open...
21
convexcube
by: convexcube | last post by:
Hi everyone, I am trying to create a single window interface for my database. As I am using Access 2007, I have my document layout options set to tabbed documents without displaying documents tabs...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.