Switchboard question

  • Thread starter Thread starter Brent
  • Start date Start date
B

Brent

How do I set a switchboard button to open a combo box that
will list all the values of a specific column in my
database for the user to select as a sort for creation of
a report?
 
If you are talking about the Switchboard Manager that creates Forms and a
File to accomplish the simple navigation that can easily be handled with
unbound Forms and Command Buttons, I don't have an answer, because I never
use it, and don't think the Switchboard Manager allows this capability.

You can create an unbound form that includes a Combo Box based on a Query
that extracts the unique values of the particular Field you are interested
in. I'm not sure how you'd use the value of a Field in Sorting a Report,
though.

Larry Linson
Microsoft Access MVP
 
I want the switchboard button to go to a report but when
the user clicks on the button, I want the user to be
asked which report they want rather than putting a button
for each report. I appreciate your feedback.
Is there a macro that can be created to serve this
purpose that could be attached to the swithboard button?
 
Brent,

Because macros don't provide for error handling, I have not used any in
years except for AutoExec and AutoKeys, so I don't try to answer macro
questions.

Solutions to this problem using a ComboBox have been posted in the past, so
it might be worth searching http://groups.google.com for the archives of
this newsgroup, microsoft.public.access.reports, and
comp.databases.ms-access.

Basically, you add a Form (and reference it from your Switchboard) that
contains a Combo Box with a RowSource that is a Query against the
undocumented (at best "semi-documented") system tables that returns the list
of report names, and then refer to that Control in a DoCmd.OpenReport
statement (and I suspect that code will be included in some of the posts).
One that discusses this, from Don Leverton, in 1998, can be linked at
http://groups.google.com/[email protected]&rnum=9

I found it by using Advanced Search to search for the all of the terms:
"reports" "combo" "box" "select" in the newsgroup comp.databases.ms-access.

Even though that was in answer to a question about Access 97, it just worked
for me when I created an unbound Form, added a Combo Box named "cboReports",
and pasted the SQL into the RowSource. In the AfterUpdate event of that
Combo Box, I put the following code and it opened the Report (note: this
does not contain any error handling code!):

Private Sub cboReports_AfterUpdate()
DoCmd.OpenReport Me![cboReports], acViewPreview
End Sub

Larry Linson
Microsoft Access MVP
 
Back
Top