Results 1 to 4 of 4
  1. #1
    arthura is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2009
    Posts
    8

    Command Button Help!

    I want to put in a command button to open a form in the Datasheet View. I realize that you can click the Datasheet View button where all of the different views are located, but I am making this for someone who wants to have a button to click on to "simplify" things.

    Here is the code I have thus far for the command button. Is there a different name I need to be using to tell it where to open?

    Thanks for the help!!!

    Private Sub Command127_Click()
    On Error GoTo Err_Command127_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "filter test"
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_Command127_Click:
    Exit Sub



    Err_Command127_Click:
    MsgBox Err.Description
    Resume Exit_Command127_Click

    End Sub

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    DoCmd.OpenForm stDocName, acFormDS, , stLinkCriteria

  3. #3
    arthura is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2009
    Posts
    8
    Awesome! Thank you!!!!

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad we could help.

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

Similar Threads

  1. command button to export to excel
    By jains in forum Forms
    Replies: 5
    Last Post: 06-30-2015, 06:27 PM
  2. Command button issue
    By sloppysly in forum Forms
    Replies: 8
    Last Post: 06-15-2009, 12:07 PM
  3. Duplicate command button
    By brettg in forum Database Design
    Replies: 1
    Last Post: 08-04-2008, 04:16 AM
  4. Command button code
    By lfolger in forum Forms
    Replies: 3
    Last Post: 03-25-2008, 04:26 PM
  5. Command button for time & date
    By joet5402 in forum Forms
    Replies: 2
    Last Post: 12-20-2007, 02:59 AM

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