X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
> Openform Where Condition Applies Filter To Opened Form?, Access 2016    
post Nov 14 2019, 04:32 PM

Posts: 8
Joined: 31-July 17

Hi all, I'm a bit confused about what I'm seeing here.

I have a database with two primary sections: Work Orders (one) and Discrepancies (many). On the Work Order form, there is a button to open the Discrepancy form and show all records for that Work Order.

I have the "Discrepancy" form, and the where condition is being applied from the button:
DoCmd.OpenForm "frmDiscrepancies", , , "[WorkOrder_FK] = " & Forms!frmWorkOrders![WorkOrder_PK]

However, this is applying a filter to "frmDiscrepancies" instead of behaving like a Where condition like I expected. My users need to be able to filter just the records associated with the Work Order they chose. Originally I had put the Where condition in the form's query, but I'd like to be able to use the same form to "View All Discrepancies" with a different button.
Am I using the wrong syntax, or does DoCmd.OpenForm not function that way?

Thanks for any help smile.gif
Go to the top of the page

Posts in this topic

Custom Search

RSSSearch   Top   Lo-Fi    24th January 2020 - 06:59 AM