473,396 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Queries on a switchboard?

I have a query that I'd like to add to my switchboard, but when I use
the switchboard manager I only get the option to run a report, a macro
or open a form. Is there a way to add a query without making it a
macro?
Nov 12 '05 #1
5 21265
On 30 Apr 2004 10:46:20 -0700, Michael Keene wrote:
I have a query that I'd like to add to my switchboard, but when I use
the switchboard manager I only get the option to run a report, a macro
or open a form. Is there a way to add a query without making it a
macro?


You must be using the switchboard generated by the Switchboard
manager.

Yes you can add the Open Query command to the switchboard, but you'll
have to also manually edit the Switchboard Items table, as the
OpenQuery will not be an option in the Manager.
It's much simpler to use a macro (or code) and set the command line to
run the macro (or code).
Create a macro (if that's what you're familiar with) to open the
query.
Edit the switch board and set the command to Run Macro. Then write the
macro name in the Macro Name box.

In code it would be the same, except you are using the Run Code
command. Place the code in Public module.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 12 '05 #2
ba*******@hotmail.com (Michael Keene) wrote ...
I have a query that I'd like to add to my switchboard, but when I use
the switchboard manager I only get the option to run a report, a macro
or open a form. Is there a way to add a query without making it a
macro?


I assume you used the Switchboard Manager to generate the switchboard?
You can add more functionality to the code, but the Switchboard
Manager won't support it--you'll need to add a button with some sort
of dummy functionality, then go directly to the table to change the
command and argument.

To add the ability to run a query, open the code behind the
switchboard form. Find the function called HandleButtonClick. There
are a bunch of constants defined at the beginning; add one for opening
a query, i.e. something like:

Const conCmdRunQuery = 9 'my addition, not supported by wizard

Next, find the end of the Select Case statement and insert a new Case
(*before* the Case Else).

' Run a query (my addition, can't use with wizard)
Case conCmdRunQuery
If IsNull(rst![Argument]) Then
On Error Resume Next
Application.Run "wzmain80.ssq_Entry"
On Error GoTo 0
Else
DoCmd.OpenQuery rst![Argument]
End If

The IsNull stuff is so that if you leave the argument blank, the Query
Wizard will come up.

As far as I recall, that's all that needs to be changed. To run a
query with a particular button, go to its row in the switchboard
table, type the query name in the Argument column, and put your new
constant (9 in my example) in the Command column.

--
HTH,
Martha
(don't google to email)
Nov 12 '05 #3
Why not create a form on the query and open that. Another simple way is to
create a macro (or code) to open the query then tell the switchboard to run
that. I have done this where the user wanted the query to open in design
view so they could enter parameters.

--
Dean Covey
www.coveyaccounting.com

MS-Office Certified:
http://www.microsoft.com/learning/mc...st/default.asp

"Michael Keene" <ba*******@hotmail.com> wrote in message
news:90**************************@posting.google.c om...
I have a query that I'd like to add to my switchboard, but when I use
the switchboard manager I only get the option to run a report, a macro
or open a form. Is there a way to add a query without making it a
macro?

Nov 12 '05 #4
I made my query into a macro and assigned that through the switchboard
and my query can now be run from the switchboard, thanks. I'm
EXTREMELY new to coding so that wasn't a viable option, hopefully
soon.

Thanks again.

fredg <fg******@example.invalid> wrote in message news:<1v*****************************@40tude.net>. ..
On 30 Apr 2004 10:46:20 -0700, Michael Keene wrote:
I have a query that I'd like to add to my switchboard, but when I use
the switchboard manager I only get the option to run a report, a macro
or open a form. Is there a way to add a query without making it a
macro?


You must be using the switchboard generated by the Switchboard
manager.

Yes you can add the Open Query command to the switchboard, but you'll
have to also manually edit the Switchboard Items table, as the
OpenQuery will not be an option in the Manager.
It's much simpler to use a macro (or code) and set the command line to
run the macro (or code).
Create a macro (if that's what you're familiar with) to open the
query.
Edit the switch board and set the command to Run Macro. Then write the
macro name in the Macro Name box.

In code it would be the same, except you are using the Run Code
command. Place the code in Public module.

Nov 12 '05 #5
Michael Keene wrote:
I have a query that I'd like to add to my switchboard, but when I use
the switchboard manager I only get the option to run a report, a macro
or open a form. Is there a way to add a query without making it a
macro?


Yes. Use RunCode. In a module put the code to open/run the query.
Then call that function in the switchboard.
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ogilby1 | last post by:
Does Access allow a query to be listed on the switchboard? Does Access allow a table to be opened in datasheet view from the switchboard? I have an application where users enter new data, print...
2
by: Terry | last post by:
I have created a switchboard, created using Access 2000. If I put the mouse anywhere on the form, outside of the checkboxes and scroll the wheel backwards, I get the following error. Run-Time...
1
by: Chuck | last post by:
I appreciate any help!!! I have an application that has 4 different forms that display the same information except for the fact that they are fed from 4 different parameter queries. The 4...
5
by: Michael Keene | last post by:
I have a query that I'd like to add to my switchboard, but when I use the switchboard manager I only get the option to run a report, a macro or open a form. Is there a way to add a query without...
1
by: jimwlee | last post by:
Hi all, I mistakenly deleted my switchboard on the Object Forms view. I recreated it again with the database utility, but the switchboard isn't showing up in the forms view. Any ideas? Thanks in...
2
by: Eric | last post by:
I have an Access 95 database. This database has run for years and now is giving me a problem. When opened, the switchboard works fine and the database functions. However, when I close the...
2
by: ghadley_00 | last post by:
Hi, Is there a way to have the labels in a MS access database switchboard dynamically generated based on values in a table? I have a table of items (let's call it table Main) , each of which is...
1
by: jerk | last post by:
Hello! I´m making a switchboard in design view. The 1st level of the switchboard contains different partners. The 2nd level contains OpenForm(s), OpenReport(s) commands for every partner. ...
2
by: Earl Anderson | last post by:
In Acc2003, I have a situation in which I have a main switchboard and upon pressing one of its buttons , takes the user to another sub hierarchical switchboard. Pressing one of these buttons could...
6
by: FaurKris | last post by:
I've got some Forms and Filters that are opened via a Switchboard when selected. They all work just fine when I open them individually (outside of the Switchboard). The Forms which only have links...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.