Open Filtered Form with Where Condition

D

Doctor

I have the code below to open a form of contacts, and I want the button to
open the form only displaying active members, but it is only opening a blank
form (the bottom does say 1 of 1 Filtered).

The information that I want to test in my code is a check box.

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "ChurchInformation"
DoCmd.OpenForm stDocName, WhereCondition:=ChurchCurrentCharter = True Or
ChurchActiveCharter = True

Any help would be tremendously appreciated.
 
K

Klatuu

The Where condition has to be all one string. It should be:
DoCmd.OpenForm stDocName, WhereCondition:= "[ChurchCurrentCharter] =
True Or [ChurchActiveCharter] = True"

ChurchCurrentCharter and ChurchActiveCharter both have to be Yes/No fields
in the ChurchInformation form's recordset.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top