Results 1 to 3 of 3
  1. #1
    Bentley is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    50

    Filtering a form records when using a button


    Hello,

    I am close, but need some assistance. I have a main form with CWP as the link between all my other forms / records. when I have my main form open and want to go to the piping portion of my next form (which I use a button to open the piping form), I would like to have the CWP of the piping match the main CWP instead of all the records showing and navigating thru. right now I get a parameter to input which is the cwp it wants to filter. Or can I change the parameter name so I do not get the criteria in the 'Where Condition" of the macro. here is what I built for the condition:

    [FRM_CWP MAIN]![CWP]=[FRM_CODE AND PIPING UPDATE 2]![CWP]

  2. #2
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    If I understand what you have, you've got it backwards. The second form should be referring to the first, not the other way around, which is what I see you doing. Try
    [FRM_CODE AND PIPING UPDATE 2]![CWP]=[FRM_CWP MAIN]![CWP] as in Form2.Field = Form1.Field.
    This assumes that the first form field being referenced is supplying a filter to the query or table upon which the second form is based.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Edit: And I think you are opening a second form /edit

    The easiest would be to use the Filter property of your form. You can assign a value to the Filter property via VBA code when you open the other form.

    From the first form, open the second form. The following would go in the click event of the first form, typed into the VBA Editor.
    Code:
    docmd.openform "NameOfPipingForm",,,"[CWP]=" & me!CWP

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

Similar Threads

  1. Filtering records by means of Option Button
    By McArthurGDM in forum Queries
    Replies: 3
    Last Post: 08-04-2014, 05:22 PM
  2. Form filtering and adding records to subform
    By Albathien in forum Forms
    Replies: 2
    Last Post: 05-09-2014, 09:31 AM
  3. Replies: 1
    Last Post: 09-04-2013, 03:24 PM
  4. Replies: 10
    Last Post: 02-12-2013, 05:04 PM
  5. Filtering records on a split form
    By Accessbeginner23 in forum Programming
    Replies: 1
    Last Post: 07-02-2012, 03:23 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