Help with forms and the switchboard.

J

James Mckillop

What I would like to do is, using the switchboard, Have
three buttons each opening the same form, but each one
opens that form using a different query for the forms
control source. I know it can be done as I have seen
someone else set it up but I did not see the code he
used. It was explained that you can export the
switchboard to a registry key and then read it back out
in the form you are trying to read and use that to
determine the query to use. But I don't know how yet.
If anyone can help I would be very greatfull.
Thanks

James
 
G

Guest

James, no registry changes needed. Much simpler. Using
the example below, in your code for each button, add this
line after opening the form.

Forms!yourformname.RecordSource = "Customers"

obviously replace yourformname with the actual form, and
where "customers" is replace it with the names of your
query(s)
 
J

James Mckillop

How can you do this when the switchboard form does not
seem to have a line of code for each button? It gets its
stuff from the table and then creates them as it opens.
At least this is what it looks like.
 
G

Guest

You should be able to have a form with as many buttons as
needed. And then the "On Click" property for each button
can have it's own code. From there you can have a
docmd.openform for each button, and then the next line of
code would be what I said previously to set the form's
record source to whatever you would like.
 
G

GVaught

The Switchboard is limited to 8 items per switchboard internal section. Thus
if you have a switchboard called Forms, then you can only list eight items
under that switchboard name. If you need to add more than eight items you
choices are:

1. Create sub switchboards under the Forms, Report menu system to
accommodate the extra forms. Note there is a way to bypass the restriction
of eight, but you must know exactly what you are doing and what code you
must change to accommodate this capability. Therefore, I will not sure this
little secret for your own safety.

2. Create your own command buttons on a form to execute your various menu
items. You are not restricted to eight items.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top