Results 1 to 6 of 6
  1. #1
    Natan is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    16

    HOW TO: Button to open different forms?

    Hi guys,

    I have a question for you,

    I have 4 sub-categories, each of them has a form.
    Also I have master category.

    I made a form to my master category details, and a button to open a form by sub-category, that I chose on the master form.

    I hope you understood me.

    programing in english is
    Open Form1 if CategoryName=1
    Open Form2 if CategoryName=2


    ..
    ..


    Thanks ahead.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If it fits that pattern:

    Dim strFormName As String
    strFormName = "Form" & CategoryName
    DoCmd.OpenForm strFormName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Natan is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    16
    Thanks.
    But where I tell it to take the CategoryName from?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I don't know; how are you choosing it?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Natan is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    16
    Combo Box, List...

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You're really hanging on tight to the details, aren't you?

    Try

    strFormName = "Form" & Me.ComboName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. cmd button to open form
    By stephaniehpcswf in forum Access
    Replies: 1
    Last Post: 02-23-2011, 04:46 PM
  2. Use a command button to open a form
    By johnpaul in forum Forms
    Replies: 24
    Last Post: 09-23-2010, 12:29 PM
  3. Button to open a Report
    By 95DSM in forum Reports
    Replies: 1
    Last Post: 07-09-2010, 11:11 AM
  4. Open a second db from a cmd button
    By Rick West in forum Access
    Replies: 3
    Last Post: 05-12-2010, 08:44 AM
  5. too many forms open
    By Jaad in forum Database Design
    Replies: 0
    Last Post: 02-22-2010, 08:39 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