Results 1 to 6 of 6
  1. #1
    mayestom is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    31

    How to open subform to specific records based off of input from combo boxes

    I need to open up a form to specific records in its subform based on user input from combo boxes (Customer and/or PKGEngineer). The two combo boxes are on a switchboard. How can this be done?
    Thank you.
    Using:
    Win 7


    Access 2010

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    You dont need a sub form. If you have a form (tab view) continuous records.
    Put the filter controls on the header and a button APPLY FILTER
    the button AFTERUPDATE event is:

    Code:
    dim vFilt
    
    if not isnull(cboST) then vFilt = vFilt & "[state]='" & cboST & "' and"
    if not isnull(txtName) then vFilt = vFilt & "[Name]='" & txtName & "' and"
    if not isnull(txtProd) then vFilt = vFilt & "[Product]='" & txtProd & "' and"
     
    
      'remove the last AND
    vFilt = Left(vFilt, InStrRev(vFilt, "AND") - 1)
    
      'Apply filter
    me.filter = vFilt 
    me.filteron = true

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    mayestom is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    31
    Sorry for the cross post. I did not know. Original post is here.
    So I'm not sure what to do? Do I post a reply on this post or reply on the original post?

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by mayestom View Post
    Sorry for the cross post. I did not know. Original post is here.So I'm not sure what to do? Do I post a reply on this post or reply on the original post?
    Hmmm I'm not sure either to be honest. Therein lays another problem when cross posting. I would suggest you reply in each thread as and you have something to post. At least as things stand now, those trying to help will be aware of the other thread. If you find a resolution to your problem I think it would be polite to let those in the other thread know.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    mayestom is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    31
    Okay. Sorry again for cross posting. I have posted a link on the original post to this post.
    ranman256 can you please post to the original post? I don't think I explained this properly. I have a little better explanation with pictures on the original post. Thank you for replying.

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

Similar Threads

  1. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  2. Replies: 6
    Last Post: 02-19-2014, 11:11 AM
  3. Replies: 5
    Last Post: 08-07-2012, 11:14 AM
  4. Selecting records based on 2 combo boxes
    By comteck in forum Database Design
    Replies: 1
    Last Post: 07-10-2012, 06:05 PM
  5. Replies: 2
    Last Post: 08-11-2011, 10:02 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