Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2011
    Posts
    13

    Unanswered: Opening Forms in Datasheet View via Switchboard

    I've got a number of forms in a database I'm building, including using forms for reports so I can freeze fields.

    I've set up a Switchboard to make form selection easier for people with limited computer experience. I want some of the forms to open in Datasheet view, but I don't seem to be able to do that via Switchboard.

    I've set the default to Datasheet via design view, but no result.

    Anyone know how I can do this?

    Norm C

  2. #2
    Join Date
    Mar 2011
    Posts
    24
    Which Access version do you use?

  3. #3
    Join Date
    Mar 2011
    Posts
    13
    Sorry. Should have mentioned. Access 2010.

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Your options are rather limited when using the Switchboard Manager, which is why the most experienced developers ignore it and 'roll their own' using a regular form. I don't believe you can do what you want from a native switchboard, produced with the manager.

    On a regular form, behind the button to open the form, you'd simply use

    DoCmd.OpenForm "FormName", acFormDS

    This is the only way to open a form in Datasheet View from another form. When opening one form from another, the second form having its Default View set to Datasheet is ignored, as you've already found out.

    You could write a function using the above code, then using the Switchboard Manager, add a button and using the Wizard have the button Run Code then enter the name of the function, but custom forms used as switchboards is really the way to go, here, in my opinion.

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Mar 2011
    Posts
    13
    Thanks for that Linq. I suspected as much.
    I'm an Access novice, so don't know how to use the program line you've given me.
    Thanks for your help.

    Norm C

  6. #6
    Join Date
    Apr 2011
    Posts
    1
    I have just done it, opened forms in datasheet view through the switchboard.

    Open the switchboard form in design view and click on the command button, on the property sheet look for the On Click action and this will be On Click = [Embedded Macro], browse the macro .., change the code for:

    Condition ->Command =1,2 etc, Action -> Open Form, change this bit ->[Argument], Datasheet, , , Add, Normal

    so instead of form after the Argumet that should be datasheet.

  7. #7
    Join Date
    May 2011
    Location
    Bellingham, WA
    Posts
    1

    Switchboard option to open a form in datasheet view

    You can do that in a couple of ways.
    Code is one way.
    Another is with a 2 step macro
    create a macro to
    1. Open the form
    2. Use "Send Keys" to change the view "%vs"
    Set the switchboard button to run the macro and you are done.



    John

  8. #8
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    SendKeys has a number of flaws, including arbitrarily toggling the NumLocks Key. In versions 2007/2010 it sometimes works and sometimes doesn't.

    Because of this, SendKeys should only be used for a mission critical task that can not be accomplished in any other way!

    Linq ;0)>
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •