Results 1 to 6 of 6
  1. #1
    amai is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    12

    Filter data in one form using a key field in a continuous form

    As a continuous form cannot have a subform, I created a main table in continuous form. Then I created the subtable in datasheet view form. I added both forms side by side in another form. Now, what I want to do is to navigate through the main form (continuous form) and filter the subform (datasheet) based on the row I select in the main form.



    Is there any way I can do this?

    Please consider that I am very new to Access. I have been successful applying simple VBA codes. However, if it is very complicated, I might not be able to apply it. If that is the case, I will appreciate if you suggest an alternative to the form.

    Thank you in advance.

    Click image for larger version. 

Name:	Database1.jpg 
Views:	16 
Size:	44.2 KB 
ID:	22968

  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
    In the current event of tehcontinuous form try:

    Forms!MainFormName.SubformControlName.Form.Filter = "InvoiceNumber = " & Me.InvoiceNumber
    Forms!MainFormName.SubformControlName.Form.FilterO n = True

    Adjusting all the names of course.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    amai is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    12
    Thank you for your quick reply. I tried your suggestion with no success. Any other suggestions?

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    As a continuous form cannot have a subform,
    Says who? I do this a lot.

    But I have never used datasheet view. I use a form in continuous form view and add controls . This way I can control placement, color, formatting, etc. that you can't do in datasheet view.

    Try this. In a COPY of your database:

    1) You have the main form displaying the invoices in continuous form view.
    2) In the main form FOOTER (I never put a subform in the detail section), add the subform (also in continuous form view). Access might complain. Ignore it. Close the dialog box.
    3) Set the main form/sub form linking fields.
    4) Then check and reset (if necessary) the forms to continuous form view. <<<=== important
    5) Switch to form view.

    Click on different main form records. If there is a related record, it should appear in the sub form.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Quote Originally Posted by amai View Post
    Thank you for your quick reply. I tried your suggestion with no success. Any other suggestions?
    What exactly did you try (your code)? Where was it? What happened?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    amai is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Nov 2015
    Posts
    12
    Thank you. This worked.

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

Similar Threads

  1. Continuous Form Filter
    By equestrian in forum Forms
    Replies: 3
    Last Post: 09-26-2015, 07:27 PM
  2. Replies: 3
    Last Post: 07-21-2014, 06:08 AM
  3. Filter email field on continuous form gives error
    By Ruegen in forum Programming
    Replies: 7
    Last Post: 10-10-2013, 09:31 PM
  4. Replies: 1
    Last Post: 11-24-2011, 07:45 AM
  5. Filter a Continuous Form
    By michel_annie22 in forum Forms
    Replies: 7
    Last Post: 11-09-2011, 07:34 AM

Tags for this Thread

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