Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    Aug 2002
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Moving between views of a form in run-time (2000)

    I would like to switch between form view and datasheet view in runtime ( so that the data could easily be copied into an Excel spreadsheet ). If there is a way to do this I am most interested, or if there is an easier way to export the data to Excel that would be cool to. The one restriction is that all of the design toolbars have been turned off from the Startup submenu. As far as I know, this means I cannot select a Table and export it. Not sure how to handle this.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Moving between views of a form in run-time (2000)

    You can create a custom toolbar for this:
    1. <LI>Open the database with the Shift key down, so that you get the standard toolbars.
      <LI>Right click any toolbar and select Customize from the context menu.
      <LI>Create a new toolbar.
      <LI>Select the Commands tab in the Customize dialog.
      <LI>Drag the commands you need to your new toolbar, e.g. Export from the File category, and Form View and Datasheet View from the View category.
      <LI>Switch back to the Toolbars tab and uncheck your custom toolbar, so that it isn't visible.
      <LI>Close the Customize dialog.
      <LI>Open the form in design view.
      <LI>In the Properties window, select the name of the custom toolbar in the Toolbar property.
    Next time you open the form, the custom toolbar will be displayed.

    Note: the custom toolbar will be saved with the database. You can import it into another database using File/Get External Data/Import... When you have selected the database, click Options>> in the Import Objects dialog. You'll see a check box for Toolbars.

  3. #3
    Lounger
    Join Date
    Aug 2002
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Moving between views of a form in run-time (2000)

    there's a twist. This method works beautifully for a form (cause I just tested it and am really impressed. So thanks already ) The problem is that the form I am interested in is a subform. The toolbar won't show up for the subform.
    I have a form. On this form is a tab control with two pages. On each page is a subform. I would like these subforms to have this custom toolbar available so that I could look at the subforms in Datasheet view. This seems more difficult. Any help is appreciated.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Moving between views of a form in run-time (2000)

    Again, open your database with the shift key down, so that you see the standard menus and toolbars.
    Open the form. You should see the menu bar and the custom toolbar.
    Right click the toolbar and select Customize.
    Click on the View menu. It has an item "Subform Datasheet". (This item is only available if you have a form open while customizing)
    Drag this item to your custom toolbar with the Ctrl key down; this copies it instead of moving it.
    Right click the new item on your custom toolbar and modify it to your liking (style, button face etc.).
    Close the Customize dialog when you're done.

    Note: the Subform Datasheet button will only be enabled when the insertion point is in a subform. If it is in the main form, the button will be disabled (greyed out).

  5. #5
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Moving between views of a form in run-time (2000)

    There is another way to get data to Excel by using the File/Export command, and then choosing Excel as your format. In some respects it may not be quite as convenient, as you have to then open the file in Excel. You can also automate the function in code by using the TransferSpreadSheet command. Hope that gives you some ideas.
    Wendell

Posting Permissions

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