Subforms with two criteria

T

Tony Williams

I have control on a sub form called txtmemnbr and I want the data to appear
in the sub form if the value matches either the value of txtmemnbr or
txttempmemnbr on the main form. There doesn't appear to be a provision in the
Properties to allow an "either or" choice, only an "and" choice. Is there
any way I can do this?
Thanks
Tony
 
A

Allen Browne

As you say, you could not do that with LinkMasterFields/LinkChildFields.

But you could do it by leaving both those properties blank, and basing the
subform on a query. In the Criteria row under the txtmdmnbr field, enter an
expression that refers to the field in the main form, e.g.:
[forms].[Form1].[txtmdmnbr]

Then in the Or row (below the Criteria row in query design) under the
txttempmemnbr field:
[forms].[Form1].[txttempmemnbr]

Or perhaps you could just use 2 subforms if these represent 2 different
kinds of memberships.
 
T

Tony Williams

As ever thanks Allen.

I'll try the query route first.

Thanks again
Tony

Allen Browne said:
As you say, you could not do that with LinkMasterFields/LinkChildFields.

But you could do it by leaving both those properties blank, and basing the
subform on a query. In the Criteria row under the txtmdmnbr field, enter an
expression that refers to the field in the main form, e.g.:
[forms].[Form1].[txtmdmnbr]

Then in the Or row (below the Criteria row in query design) under the
txttempmemnbr field:
[forms].[Form1].[txttempmemnbr]

Or perhaps you could just use 2 subforms if these represent 2 different
kinds of memberships.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Tony Williams said:
I have control on a sub form called txtmemnbr and I want the data to appear
in the sub form if the value matches either the value of txtmemnbr or
txttempmemnbr on the main form. There doesn't appear to be a provision in
the
Properties to allow an "either or" choice, only an "and" choice. Is there
any way I can do this?
Thanks
Tony
 

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