Results 1 to 10 of 10
  1. #1
    jacksparrow is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    5

    Creating a from with options that leads to suboptions with search criteria

    Hello and thanks in advance.



    I am new to forms. My project deals with creating a form that provides 4 options to users, upon clicking any of the option, it will allow a user to enter parameters/search criteria to print a report.

    I need help with how to create form that will take user from first form (with 4 options) to another form (with search criteria input)

    I currently have this setup by creating a separate form for each of the 4 options and call them using onclick function. However, this opens each form in its own tab.

    I want to create something where everything is taking in one form, meaning the search criteria will open up in the same form as where the options are listed. Is this only achievable using VBA?

    Any help is greatly appreciated.

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    You could use a tab control, one page for each of the forms. The user will then select the page they require.

    Or set them visible/invisible during each onclick event. I'm not sure but I think the latter can be done in a macro.

  3. #3
    jacksparrow is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    5
    Can it be not done in SubForm? The 4 options open subform upon clicking?

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    A subform is just a form which becomes an object on another (parent) form. It does get opened but is displayed when the parent is opened. All you can do is make the subforms visible/invisible, so that in the OnClick event the macro will set three of the subforms to invisible and the selected one visible.

  5. #5
    jacksparrow is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    5
    Quote Originally Posted by aytee111 View Post
    A subform is just a form which becomes an object on another (parent) form. It does get opened but is displayed when the parent is opened. All you can do is make the subforms visible/invisible, so that in the OnClick event the macro will set three of the subforms to invisible and the selected one visible.
    Yup that I think will do. Would you be able to help with the event procedure code?

  6. #6
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Sure.

    The first question is, how do the users select an option? It is an option group or a textbox or ...? This will determine which event is fired off and where/how the code is done.

  7. #7
    jacksparrow is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    5
    Quote Originally Posted by aytee111 View Post
    Sure.

    The first question is, how do the users select an option? It is an option group or a textbox or ...? This will determine which event is fired off and where/how the code is done.
    It's command button. I am attaching the database with the forms in talk. As you will see the main form is Form1 with 4 options. The first three options has their own separate forms that I've created.

    One method we talked above. The other method I was trying is to bring the elements from separate forms on the main form (Form1) and group them together and hide/unhide them when the appropriate option is selected. This is the method my manager had suggested. Please let me know how it is achievable and thanks for your help!
    Attached Files Attached Files

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

  9. #9
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I used the subform method - Form2.
    Attached Files Attached Files

  10. #10
    jacksparrow is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2018
    Posts
    5
    Quote Originally Posted by aytee111 View Post
    I used the subform method - Form2.
    Thank you so much! I used your method and showed to my boss. She wanted me to use the other method. After searching online, I end up using the below code to figure it out. We grouped together the elements and tagged the groups. We had 3 groups as you see below in the code. The code below will hide the two groups and unhide the one group that the user had picked as an option.

    I appreciate your code. Because of you, now I know how to do it two ways.

    Dim ctrl As Control
    For Each ctrl In Me.Controls
    If ctrl.Tag = "Mbr_Detail" Or ctrl.Tag = "Svc_Month" Then
    ctrl.Visible = False


    Else: ctrl.Visible = True
    End If
    Next

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

Similar Threads

  1. Look Up - show fewer options by matching criteria....?
    By synses in forum Database Design
    Replies: 3
    Last Post: 03-13-2017, 02:33 PM
  2. Replies: 3
    Last Post: 12-14-2016, 03:14 AM
  3. Creating Multiple Dependant User Options
    By s.carter in forum Database Design
    Replies: 3
    Last Post: 06-28-2015, 09:24 AM
  4. Multiple options for query criteria
    By graccess in forum Queries
    Replies: 2
    Last Post: 03-17-2014, 05:01 PM
  5. Replies: 3
    Last Post: 07-14-2013, 09:16 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