I used the switchboard manager to create the switchboard, so I actually
didn't write any code using VBA or anything else. I did open the switchboard
and look at the code, it appears to be rather broad, it doesn't have code
such as what you suggested.
Can you give me some more info as to how I would change the code or what
settings I would change for the switchboard? I don't want all the forms to
open in datasheet view, only specific ones.
Thanks
There are Switchboards and there are Switchboards. Unless you
specifically state you are using the one created by the Switchboard
Manager we have no way of knowing what you have.
The built-in switchboard manager creates a complicated method for a
simple problem.
You will need to make a change in the code behind the Switchboard, and
then change a value in the Switchboard Items table.
Open the Switchboard form's code window.
Find the Function HandleButton_Click(....) function.
Drop down to the const declarations code. Add:
Const conCmdOpenFormDatasheet = 9
to the list.
Further down in the function, within the Select Case statements, add
Case conCmdOpenFormDatasheet
DoCmd.OpenForm rst!Argument, acFormDS
Save the changes.
Then open the Switchboard Items table and change the Command value for
that form you wish to open from its current 2 or 3 to 9.
That should do it.
You will not be able to use the manager to edit this or open other
forms in Datasheet View.
If you need to open a different form in Datasheet View you will have
to change that form's Command value in the Switchboard Items table.
Much better to create your own Switchboard using an unbound form and
command buttons. If you use the Command Button Wizard when adding the
buttons, Access will write most of the code for you. You'll have more
control over it's appearance and maintenance will be simpler.