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
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 Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "Tony Williams" wrote in message news:A5C9FC55-B663-40A0-A206-372564F3C4BE@microsoft.com... >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
As ever thanks Allen. I'll try the query route first. Thanks again Tony "Allen Browne" wrote: > 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 > Tips for Access users - http://allenbrowne.com/tips.html > Reply to group, rather than allenbrowne at mvps dot org. > > "Tony Williams" wrote in message > news:A5C9FC55-B663-40A0-A206-372564F3C4BE@microsoft.com... > >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 > >