A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

datasheet forms open in form mode from the Switchboard



 
 
Thread Tools Display Modes
  #1  
Old July 12th, 2004, 02:02 AM
Paul James
external usenet poster
 
Posts: n/a
Default datasheet forms open in form mode from the Switchboard

I've got some forms that I would only like to open in datasheet view, so I
set the Default View property to Datasheet, and all the other form view
properties to "No."

However, when these forms open from my Switchboard form, which I created
from the Switchboard Manager, these forms all open in Form View. I tried
looking at the code in the Switchboard as well as the parameters in the
Switchboard Items table, but I couldn't figure out any way to tell it to
open certain forms in datasheet view.

Is there any way I can get these forms to open from the Switchboard in
Datasheet View or, alternatively, is there VBA code I could put in the
forms' Open event that would change it to Datasheet view?

Thanks in advance,

Paul


  #2  
Old July 12th, 2004, 02:57 AM
Jeff Conrad
external usenet poster
 
Posts: n/a
Default datasheet forms open in form mode from the Switchboard

Hi Paul,

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 Add/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
when launched from the Switchboard, 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


"Paul James" wrote in message
...
I've got some forms that I would only like to open in datasheet view, so I
set the Default View property to Datasheet, and all the other form view
properties to "No."

However, when these forms open from my Switchboard form, which I created
from the Switchboard Manager, these forms all open in Form View. I tried
looking at the code in the Switchboard as well as the parameters in the
Switchboard Items table, but I couldn't figure out any way to tell it to
open certain forms in datasheet view.

Is there any way I can get these forms to open from the Switchboard in
Datasheet View or, alternatively, is there VBA code I could put in the
forms' Open event that would change it to Datasheet view?

Thanks in advance,

Paul



  #3  
Old July 12th, 2004, 05:25 AM
Paul James
external usenet poster
 
Posts: n/a
Default datasheet forms open in form mode from the Switchboard

Wow. What a great way to expand the options on a Switchboard!

Thanks so much for explaining how to do it.



  #4  
Old July 12th, 2004, 06:28 AM
Jeff Conrad
external usenet poster
 
Posts: n/a
Default datasheet forms open in form mode from the Switchboard

You're welcome, glad to help.

--
Jeff Conrad
Access Junkie
Bend, Oregon


"Paul James" wrote in message
...
Wow. What a great way to expand the options on a Switchboard!

Thanks so much for explaining how to do it.



  #5  
Old July 12th, 2004, 08:08 PM
Tom Ross
external usenet poster
 
Posts: n/a
Default datasheet forms open in form mode from the Switchboard

Another simplier solution is to create a macro that calls the form as
datasheet and call the macro from your switchboard


"Paul James" wrote in message
...
I've got some forms that I would only like to open in datasheet view, so I
set the Default View property to Datasheet, and all the other form view
properties to "No."

However, when these forms open from my Switchboard form, which I created
from the Switchboard Manager, these forms all open in Form View. I tried
looking at the code in the Switchboard as well as the parameters in the
Switchboard Items table, but I couldn't figure out any way to tell it to
open certain forms in datasheet view.

Is there any way I can get these forms to open from the Switchboard in
Datasheet View or, alternatively, is there VBA code I could put in the
forms' Open event that would change it to Datasheet view?

Thanks in advance,

Paul




  #6  
Old July 13th, 2004, 06:51 AM
Paul James
external usenet poster
 
Posts: n/a
Default datasheet forms open in form mode from the Switchboard

Another great idea. Thanks, Tom.

I've overlooked the fact that you can call macros from the Switchboard. I'm
glad you pointed that out.

Paul


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
auto entry into second table after update Tony New Users 13 July 9th, 2004 10:42 PM
How to syncronize a datasheet form and single form? Sandra Using Forms 9 June 16th, 2004 05:24 AM
matching multiple forms on open to form records EdwardA Using Forms 0 June 10th, 2004 06:38 PM
Populate two+ fields on a Form, based on a pop up form's record Michael Miller Using Forms 0 June 9th, 2004 02:56 PM
how to start a form in datasheet view from the switchboard William Wenjie Wang New Users 3 June 1st, 2004 04:30 AM


All times are GMT +1. The time now is 12:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.