Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using DoCmd.OpenForm "filter Query" argument 2

Status
Not open for further replies.

clrinc

MIS
Apr 26, 2005
3
US
I have a form named “Contracts”. It’s record source is the query “selContracts” that contains a field named “ContractID”. Executing the form produces 10,797 records.
I have a table named “CofirmContIDs” that contains a key field named “ContractID” and contains 16 records.
I have a query, “selContractsSubSet”, using the following SQL string; “SELECT * FROM ConfirmContIDs INNER JOIN selContracts ON
ConfirmContIDs.ContractID = selContracts.ContractID”. Executing this query produces 16 records.
Executing opening the Contracts form using DoCmd.OpenForm "Contracts", , "selContractsSubSet" produces 10,797 records.
 
Have you tried this ?
DoCmd.OpenForm "Contracts", , , "ContractID IN (SELECT ContractID FROM ConfirmContIDs)"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Fantastic!! It works perfectly. I would never have recognized this as a "where" parameter, however I'm not an SQL heavyweight. If you could point me to documentation that covers this information I would appreciate it.
I would still like to know how to use the "filter" argument to the Openform Docmd.

Thanks Clrinc
 
I am not aware of anyone who uses the filter argument. There are lots of great resources on the web regarding SQL statements and where clauses/conditions.

Tek-Tips is a great place to come with specific questions.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top