Data view for form

L

LG

I created an edit form and the form is linked to a switchboard button. How do
i keep the form in a spreadsheet view when the button of the switchboard is
clicked?
 
G

golfinray

In the properties of the form itself, go to properties, then format and set
the default view.
 
L

LG

I have done that already but when you click on the button from the swithboard
it still opens in form view.
 
F

fredg

I have done that already but when you click on the button from the swithboard
it still opens in form view.

Regardless of how you have set up your form to open,
if you are opening it from an event on another form you
must specify Datasheet view (NOT SPEADSHEET view!).

If you were using your own form with a command button, the button's
click event code would be:

DoCmd.OpenForm "FormName", acFormDS

But I gather you are using the Microsoft Add-In switchboard.
Life would be simpler for you if you didn't, and made use of an
unbound form with command buttons.
Much more versatile, and easier to maintain.
And Access will write most of the code if you use the command button
wizard.

Using the built-in Switchboard, however, you'll need to go into the
Switchboard code window and add some code.

Open the Switchboard Code window.

Find the
Private Function HandleButtonClick(intBtn As Integer)
code line.
A few lines down you'll find the Constants listed.
Add
Const conCmdOpenFormDS = 9
at the end of the list (I believe there are originally just 8
constants).

Then go down further into the Select Case statements.
Add

Case conCmdOpenFormDS
DoCmd.OpenForm rs!Argument, acFormDS

just before the Case Else statement.

Close the code window.

Open the Switchboard Items table.
Change the Command value for the form you wish to
open from it's current number (either 2 or 3) to 9.

That should do it.
You cannot make or edit this change using the Switchboard manager.
You must work around it, as above.

Best advice I can give you is to make your own switchboard form.
 

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