UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Custom Ribbon With Run Query Button, Access 2010    
 
   
boston
post May 18 2017, 04:20 PM
Post#1



Posts: 41
Joined: 19-June 12
From: Ft. Worth, TX


Hello,

I have a database that has a query that opens in design view so that the users can input different criteria then run the query. However, I need to lock down the database so that the users only have the option to run that query and not be able to use the "File" menu to get to the "Privacy Options." I found the following xml code for a custom ribbon that hides the "File" menu using a system table. It works perfectly, but I need the option to run a query. Can anyone tell me how to add a "Run Query" button to this code? Thank you for your help.

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="true">
</ribbon>

<backstage>
<!-- <button idMso="FileSave" visible="false"/> -->
<!-- <button idMso="SaveObjectAs" visible="false"/> -->
<!-- <button idMso="FileSaveAsCurrentFileFormat" visible="false"/> -->
<!-- <button idMso="FileOpen" visible="false"/> -->
<!-- <button idMso="FileCloseDatabase" visible="false"/> -->
<!-- <tab idMso="TabInfo" visible="false"/> -->
<!-- <tab idMso="TabRecent" visible="false"/> -->
<!-- <tab idMso="TabNew" visible="false"/> -->
<!-- <tab idMso="TabPrint" visible="false"/> -->
<!-- <tab idMso="TabShare" visible="false"/> -->
<!-- <tab idMso="TabHelp" visible="false"/> -->
<tab idMso="TabPrint" visible="false"/>
<button idMso="ApplicationOptionsDialog" visible="false"/>
<button idMso="FileExit" visible="false"/>
</backstage>

</customUI>
Go to the top of the page
 
doctor9
post May 18 2017, 04:45 PM
Post#2


Remembered
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


boston,

You can set up a ribbon button to run a function, so write a function that opens the query.

<button id="btnListCustomers" label="List Customers" imageMso="MailMergeGoToNextRecord" onAction="NameOfYourFunctionHere" />

Better yet, I'd recommend creating a FORM that the users use to select different criteria, which is much safer than allowing the users to edit queries directly. If you do this, your function would open the form, and the code on your form would create the custom query based on the values entered/selected on the form.

Hope this helps,

Dennis
Go to the top of the page
 
HiTechCoach
post May 18 2017, 07:31 PM
Post#3


UtterAccess VIP
Posts: 19,008
Joined: 29-September 03
From: Oklahoma City, Oklahoma


You can have:
QUOTE
I have a database that has a query that opens in design view so that the users can input different criteria then run the query.

or
QUOTE
I need to lock down the database so that the users only have the option to run that query


I don't see any way to do both.

A user in query design mode could potentially to run any SQL statement. This includes deleting all the data from your database.

I agree with Dennis that you should use a form. Especially is your goal is to lock down the database and protect your data.

Something like this:
Search criteria

Go to the top of the page
 
boston
post May 19 2017, 07:46 AM
Post#4



Posts: 41
Joined: 19-June 12
From: Ft. Worth, TX


Thank you both for your replies. I think the form is an excellent solution to my problem. I'm going to get to work on that. Thanks so much for your advice!
Go to the top of the page
 
HiTechCoach
post May 19 2017, 11:45 AM
Post#5


UtterAccess VIP
Posts: 19,008
Joined: 29-September 03
From: Oklahoma City, Oklahoma


You're welcome.

Glad we could assist.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    17th October 2018 - 02:08 PM