Opening From from Switchboard

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All:

I have created a small database and also created a switchboard using the
wizard. I need to open my forms in datasheet mode and have set the
properties of the form so that this is the only mode available.

When I open the forms directly they open in datasheet mode. However, when I
use the button on the swicthboard, they all open in form mode. This is
Access 2003.

Any suggestions would be appreciated.

Thanks
Brennan
 
Hi All:

I have created a small database and also created a switchboard using the
wizard. I need to open my forms in datasheet mode and have set the
properties of the form so that this is the only mode available.

When I open the forms directly they open in datasheet mode. However, when I
use the button on the swicthboard, they all open in form mode. This is
Access 2003.

Any suggestions would be appreciated.

Thanks
Brennan

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.
I gather you are using the Microsoft Add-In switchboard manager.
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, you CAN open a form in Datasheet view from the
Microsoft 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.
You cannot make or edit these changes using the Switchboard manager.
You must work around it, as above.

Best advice I can give you is to make your own switchboard form.
 
fredg said:
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.
I gather you are using the Microsoft Add-In switchboard manager.
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, you CAN open a form in Datasheet view from the
Microsoft 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.
You cannot make or edit these changes using the Switchboard manager.
You must work around it, as above.

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

Thanks Fred:

I think you are right. I was trying to do a quick and dirty

Thanks
 
Back
Top