datasheet view thru switchboard manager

M

mhmaid

1.i am trying to open one form in datasheet view thru switchboard manager ,
but it will show normal form . what is the sol.?
 
F

fredg

1.i am trying to open one form in datasheet view thru switchboard manager ,
but it will show normal form . what is the sol.?

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:

DoCmd.OpenForm "FormName", acFormDS

Now you have several difficulties.
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.

Which brings us back to your opening the form in datasheet view. If
you are using the built in switchboard, 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 rst!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.

Better 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