Results 1 to 8 of 8
  1. #1
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169

    How to create a datasheet toggle button

    Hello,



    I have a contact list db that displays in datasheet view on startup. I also have an alternate form that displays in datasheet mode that i want to be able to toggle to with a click of a button. I would like the button to appear at the top of the default datasheet form, that will allow a user to toggle to the alternate form when they need to. Any ideas?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Buttons don't display with Datasheet view. Can use Continuous view and arrange controls to appear like datasheet.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    You can try something like
    DoCmd.RunCommand acCmdView and

    DoCmd.RunCommand acCmdDatasheetView

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    I did a test. Click toggle to go from FormView to DatasheetView, the toggle button is no longer available.

    Not acCmdView, it is acCmdFormView
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    hmm...i may have used the wrong term to describe the form type. My default view is a fullscreen docked type form, showing a list of my contacts. I assumed that was called a datasheet view, but I may be wrong. I just want to be able to instantly switch to a alternate form with the click of a button. Hope that clarifies.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Doesn't matter if full screen, docked, tabbed, or overlapping form. Form in Continuous or Single view and buttons are available. Switch to Datasheet view and buttons no longer available. Controls can be arranged in Continuous view to look like a datasheet. Default View property of form sets the view form opens as.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    tobydobo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Posts
    169
    Ok so could u show me how to toggle to my alternate continuous form using a button command? I want the button to switch forms not just launch a new form; thusly hiding the previous form when the button is pressed, and vice versa.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Unfortuntely, doesn't appear to be an acCmdContinuousView parameter.

    Could use a button to switch to datasheet view then a double click on datasheet to return to form view. Code like:

    Private Sub Command8_Click()
    DoCmd.RunCommand acCmdDatasheetView
    End Sub

    Private Sub Form_DblClick(Cancel As Integer)
    DoCmd.RunCommand acCmdFormView
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Making a toggle button hide a text box.
    By RemonKoybito in forum Forms
    Replies: 3
    Last Post: 05-20-2011, 11:34 AM
  2. Toggle Button on Bound Form
    By P5C768 in forum Forms
    Replies: 7
    Last Post: 12-30-2010, 03:00 PM
  3. Replies: 1
    Last Post: 09-13-2010, 01:57 PM
  4. Replies: 3
    Last Post: 09-09-2010, 08:02 AM
  5. Toggle Button Options
    By Matthieu in forum Forms
    Replies: 2
    Last Post: 11-23-2009, 04:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums