Viewing forms in datasheet mode from a switchboard

A

Alison

I am creating a database with lots of forms based in queries that are
datasheet, and non-editable for the end user.

I want the user to be able to access these forms, in their datasheet view,
from the switchboard.

I only seem to be able to open the form in tabular view.

How can I do this?
 
F

fredg

I am creating a database with lots of forms based in queries that are
datasheet, and non-editable for the end user.

I want the user to be able to access these forms, in their datasheet view,
from the switchboard.

I only seem to be able to open the form in tabular view.

How can I do this?

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

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.

That being said, if you are using that Microsoft Add-in Switchboard
and wish to open a form in datasheet view, you need to make a change
in it's 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.

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