Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Sun, 28 Sep 2008 03:54:00 -0700,    group: microsoft.public.access.forms        back       


Subforms with two criteria   
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
date: Sun, 28 Sep 2008 03:54:00 -0700   author:   Tony Williams

Re: Subforms with two criteria   
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
date: Sun, 28 Sep 2008 21:50:48 +0800   author:   Allen Browne lid

Re: Subforms with two criteria   
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 
> 
>
date: Sun, 28 Sep 2008 08:32:01 -0700   author:   Tony Williams

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us