Switchboard form views

G

Garry

Hi All

From the Switchboard, I want to open a form in datasheet view.
The Switchboard options are to open the form to add or edit.
The form always opens in form view no matter what I saved it in.
I want datasheet as to paste a number of records at a time.
Any suggestions regards Garry
 
B

Bob

The switchboard merely opens the form to the default view
as defined in your form design.

While in form design of your switchboard,
select "Datasheet" as the default view on the Properties
page. Under "Views Allowed" you can all choose "Datasheet".
 
J

Jeff Conrad

Hi Garry,

You have three options (at least) available to you.

1. You could make your form into a Continuous Form and
design it so it *looks* just like a datasheet. Then open
it in Edit mode from the Switchboard.

2. You could design your own "Switchboard-type" form and
launch all your procedures from there.

3. You can change the Switchboard code a little bit to
achieve your desired result. The Switchboard automatically
will open a form in Single view. If you change the code to
datasheet view then ALL forms will open in Datasheet view
which is probably not a good thing. If you would like to
have the best of both worlds, follow these instructions on
a BACK-UP COPY.

Open the Switchboard code. Find the area that has this:

' Constants for the commands that can be executed.
Const conCmdGotoSwitchboard = 1
Const conCmdOpenFormAdd = 2
Const conCmdOpenFormBrowse = 3
Const conCmdOpenReport = 4
Const conCmdCustomizeSwitchboard = 5
Const conCmdExitApplication = 6
Const conCmdRunMacro = 7
Const conCmdRunCode = 8

Add one more line to the list like this:

Const conCmdOpenFormDatasheet = 9

Now go a little further down the code until you come to
this area:

' Run code.
Case conCmdRunCode
Application.Run rst![Argument]

' Any other command is unrecognized.
Case Else
MsgBox "Unknown option."

In between these two areas we want to add another one for
datasheet view. Add in this new code in the middle so it
looks like this:

' Run code.
Case conCmdRunCode
Application.Run rst![Argument]

' Open a form in Datasheet Mode.
Case conCmdOpenFormDatasheet
DoCmd.OpenForm rst![Argument], acFormDS

' Any other command is unrecognized.
Case Else
MsgBox "Unknown option."

Compile and save the form.

Now you will NOT be able to use the Switchboard Wizard to
use this option. The Wizard will only use the 8 pre-
defined options. To open a form in Datasheet View you will
need to go directly to the Switchboard Items TABLE and add
it yourself. If you study the records you will figure out
what is going on. Just use the number 9 in the Command
field to open a form in datasheet view and showing all
records.
 
G

Garry

Thanks Jeff
Options 1 & 3 came up trumps, many thanks for your time
all the best Garry


Jeff Conrad said:
Hi Garry,

You have three options (at least) available to you.

1. You could make your form into a Continuous Form and
design it so it *looks* just like a datasheet. Then open
it in Edit mode from the Switchboard.

2. You could design your own "Switchboard-type" form and
launch all your procedures from there.

3. You can change the Switchboard code a little bit to
achieve your desired result. The Switchboard automatically
will open a form in Single view. If you change the code to
datasheet view then ALL forms will open in Datasheet view
which is probably not a good thing. If you would like to
have the best of both worlds, follow these instructions on
a BACK-UP COPY.

Open the Switchboard code. Find the area that has this:

' Constants for the commands that can be executed.
Const conCmdGotoSwitchboard = 1
Const conCmdOpenFormAdd = 2
Const conCmdOpenFormBrowse = 3
Const conCmdOpenReport = 4
Const conCmdCustomizeSwitchboard = 5
Const conCmdExitApplication = 6
Const conCmdRunMacro = 7
Const conCmdRunCode = 8

Add one more line to the list like this:

Const conCmdOpenFormDatasheet = 9

Now go a little further down the code until you come to
this area:

' Run code.
Case conCmdRunCode
Application.Run rst![Argument]

' Any other command is unrecognized.
Case Else
MsgBox "Unknown option."

In between these two areas we want to add another one for
datasheet view. Add in this new code in the middle so it
looks like this:

' Run code.
Case conCmdRunCode
Application.Run rst![Argument]

' Open a form in Datasheet Mode.
Case conCmdOpenFormDatasheet
DoCmd.OpenForm rst![Argument], acFormDS

' Any other command is unrecognized.
Case Else
MsgBox "Unknown option."

Compile and save the form.

Now you will NOT be able to use the Switchboard Wizard to
use this option. The Wizard will only use the 8 pre-
defined options. To open a form in Datasheet View you will
need to go directly to the Switchboard Items TABLE and add
it yourself. If you study the records you will figure out
what is going on. Just use the number 9 in the Command
field to open a form in datasheet view and showing all
records.

--
Jeff Conrad
Access Junkie
Bend, Oregon

Hi All

From the Switchboard, I want to open a form in datasheet view.
The Switchboard options are to open the form to add or edit.
The form always opens in form view no matter what I saved it in.
I want datasheet as to paste a number of records at a time.
Any suggestions regards Garry
 
J

Jeff Conrad

You're welcome, glad to help.

--
Jeff Conrad
Access Junkie
Bend, Oregon

Garry said:
Thanks Jeff
Options 1 & 3 came up trumps, many thanks for your time
all the best Garry


Jeff Conrad said:
Hi Garry,

You have three options (at least) available to you.

1. You could make your form into a Continuous Form and
design it so it *looks* just like a datasheet. Then open
it in Edit mode from the Switchboard.

2. You could design your own "Switchboard-type" form and
launch all your procedures from there.

3. You can change the Switchboard code a little bit to
achieve your desired result. The Switchboard automatically
will open a form in Single view. If you change the code to
datasheet view then ALL forms will open in Datasheet view
which is probably not a good thing. If you would like to
have the best of both worlds, follow these instructions on
a BACK-UP COPY.

Open the Switchboard code. Find the area that has this:

' Constants for the commands that can be executed.
Const conCmdGotoSwitchboard = 1
Const conCmdOpenFormAdd = 2
Const conCmdOpenFormBrowse = 3
Const conCmdOpenReport = 4
Const conCmdCustomizeSwitchboard = 5
Const conCmdExitApplication = 6
Const conCmdRunMacro = 7
Const conCmdRunCode = 8

Add one more line to the list like this:

Const conCmdOpenFormDatasheet = 9

Now go a little further down the code until you come to
this area:

' Run code.
Case conCmdRunCode
Application.Run rst![Argument]

' Any other command is unrecognized.
Case Else
MsgBox "Unknown option."

In between these two areas we want to add another one for
datasheet view. Add in this new code in the middle so it
looks like this:

' Run code.
Case conCmdRunCode
Application.Run rst![Argument]

' Open a form in Datasheet Mode.
Case conCmdOpenFormDatasheet
DoCmd.OpenForm rst![Argument], acFormDS

' Any other command is unrecognized.
Case Else
MsgBox "Unknown option."

Compile and save the form.

Now you will NOT be able to use the Switchboard Wizard to
use this option. The Wizard will only use the 8 pre-
defined options. To open a form in Datasheet View you will
need to go directly to the Switchboard Items TABLE and add
it yourself. If you study the records you will figure out
what is going on. Just use the number 9 in the Command
field to open a form in datasheet view and showing all
records.

--
Jeff Conrad
Access Junkie
Bend, Oregon

Hi All

From the Switchboard, I want to open a form in datasheet view.
The Switchboard options are to open the form to add or edit.
The form always opens in form view no matter what I saved it in.
I want datasheet as to paste a number of records at a time.
Any suggestions regards Garry
 

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

Similar Threads

Switchboard doesn't open the form with the correct view 4
Switchboard & Forms 5
creating a form 4
Open form in Datasheet View? 3
Access Switchboard error message 1
Open Form in datasheet view 3
switchboard question 5
Switchboard 4

Top