Open form using dual Criteria

  • Thread starter Thread starter Yor Suiris
  • Start date Start date
Y

Yor Suiris

Ok I create a button to open a subform based on a field in the parent form.
Easy.
How do I do the same thing but using Two or more fields?
I thought it would be as simple as an AND., such as

stLinkCriteria = "[Active]= TRUE" And "[For]=" & DatePart("yyyy", Date)

With either part of the statement it works, but when I try to do both I get
a Type Mismatch.

Can someone maybe offer a pointer or two. Thanks for your time.
 
Yor Suiris said:
Ok I create a button to open a subform based on a field in the parent form.
Easy.
How do I do the same thing but using Two or more fields?
I thought it would be as simple as an AND., such as

stLinkCriteria = "[Active]= TRUE" And "[For]=" & DatePart("yyyy", Date)

With either part of the statement it works, but when I try to do both I get
a Type Mismatch.

Try this:

stLinkCriteria = "[Active]= TRUE And [For]=" & DatePart("yyyy", Date)

Tom Lake
 
Thanks Tom, it is always those little things. I can't say how many times I
went over that and did not notice the """"s.

Tom Lake said:
Yor Suiris said:
Ok I create a button to open a subform based on a field in the parent form.
Easy.
How do I do the same thing but using Two or more fields?
I thought it would be as simple as an AND., such as

stLinkCriteria = "[Active]= TRUE" And "[For]=" & DatePart("yyyy", Date)

With either part of the statement it works, but when I try to do both I get
a Type Mismatch.

Try this:

stLinkCriteria = "[Active]= TRUE And [For]=" & DatePart("yyyy", Date)

Tom Lake
 
Back
Top