473,651 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 21311
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*******@hotma il.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 HandleButtonCli ck. 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_E ntry"
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*******@hotm ail.com> wrote in message
news:90******** *************** ***@posting.goo gle.com...
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******@examp le.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
7237
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 reports, (based on a parameter query), and edit previously entered data in form view.
2
2158
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 Error '-2147217900(8004e14)': Syntax Error (missing operator) in query expression in '>0 and =' I know that the Switchboard probably doesn't cater for this event but sometimes you can't help twiddling the wheel can you?
1
2947
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 different forms are activated by 4 different buttons on the main switchboard. Of course, this makes me change 4 different forms when I make a change to any of them. Is there anyway to open one form from different queries when different buttons are...
5
2211
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 making it a macro?
1
4516
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 advance. Jim Lee
2
1843
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 switchboard and try to open a table, query or report, the tabs show up for table, query, report and etc. However, the white box that lists the names of the tables, queries, reports does not appear. A small rectangle appears in the upper left hand corner of...
2
3115
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 assigned to a category. The list of categories is stored in a separate linked table (let's call it Categories). The Categories table consists of entries that have an ID number and a name. I have made queries of the Main table where I make the...
1
1303
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. The form(s) and report(s) are always the same...for example...frmOne and rptOne, but every partner has his own tables, queries...for example tblOnePartner1, tblOnePartner2, tblTwoPartner1, tblTwoPartner2. The table One and table Two has the same...
2
2858
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 take the user to another switchboard or to forms within the topical heading of the switchboard. What I would like to see is a "Screen Tip" type feature in which when the mouse cursor is 'rested' upon a particular Switchboard button, the 'top...
6
4170
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 to reports, open their respective Reports and display the data without issue. BUT the Forms and Filters which display live data (and allow for the adding/deleting of records) from the Queries show NO data at all WHEN BEING OPENED FROM INSIDE THE...
0
8352
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8579
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5612
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1587
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.