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  

Calling forms using Switchboard



 
 
Thread Tools Display Modes
  #11  
Old May 6th, 2010, 08:15 PM posted to microsoft.public.access.forms
JR Hester
external usenet poster
 
Posts: 375
Default Calling forms using Switchboard

Thanks for posting that! I too would have tried the 10 and become frustrated.
After reading your post, I tried "A" thinking of teh old bexadecimal
numbering scheme. Unfortunately that did not work because teh Switchboard
form table expects a numeric entryin that field.

I did get around teh issue by using the ninth option which was designed for
access page. Since my application does not use the access page, I simoply
remarked out the code dealing with access page and inserted the openForm in
datasheet cview code below it!

Worked great!

"GoBrowns!" wrote:

I am totally confused, and having this same problem.

Looking at the code, I already have a #9, for "Const conCmdOpenPage".

I tried to insert a new line as #10 for "Const conCmdOpenFormDatasheet: but
no luck.

Please help!



"NewSysAdmin" wrote:

I know how reliant you can become on message boards when you have a problem
that you're stuck on, so I'm posting the following solution. Sorry, I posted
the previous response without testing it fully. My previous post appears to
work until you try another page of the Switchboard, when you click the 6th
and 7th buttons, it does the same thing (tries to open a form in datasheet
view), which I did not want. Please see below for the solution I found that
REALLY WORKS (found on another discussion board posted by Jeff Conrad.) It
involves changing the Switchboard code.

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 rs![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 rs![Argument]

' Open a form in Datasheet Mode.
Case conCmdOpenFormDatasheet
DoCmd.OpenForm rs![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.




"NewSysAdmin" wrote:

I tried the previous post, and it gave me an error executing the command. By
searching another message board, I found this solution. I added the below
code to the button which the user would click to open the form in datasheet
mode. I put it into an Event Procedure called by the On Click Event.

Private Sub Option6_Click()

DoCmd.OpenForm "Form Name here", acFormDS

End Sub

This worked for me, and seemed to be a very simple fix.

"Mark Phillipson" wrote:

Hi,

The way I do it is:

Create a Function in a Code Module and run the function from the switchboard
(Run Code command).

The code would be something like:

Public Function OpenMyFormInDSView

DoCmd.OpenForm "frmName", acFormDS

End Function


--
HTH

Mark Phillipson

Free Add-Ins at; http://mphillipson.users.btopenworld.com/
"kash" wrote in message
...
How can I call a form in a Datasheet View using a Switchboard?



 




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
Putting something on the switchboard Jenn Connors New Users 5 November 5th, 2004 02:38 PM
Switchboards Jenn Connors New Users 1 October 30th, 2004 09:48 AM
closing all forms except main switchboard gemma charters Using Forms 1 August 22nd, 2004 04:42 PM
datasheet forms open in form mode from the Switchboard Paul James Using Forms 5 July 13th, 2004 06:51 AM


All times are GMT +1. The time now is 05:32 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.