doub (Visitor) Aug 7, 2001
I`ve a Form including two subforms;
behind the subforms are two queries. I only want the subforms to make visible when the queries behind them have got data, else . visible = false
it will work the way you want right from the start and on the underlying queries, have the following criteria (as I presume you want the subs to show up based on the value of the main form?!) that checks against the form first. calculates the forms contents and if it matches specific stuff.
i.e.
mainform has a text box called [postcode]
form has two subforms, subform1 and subform2
in the postcode text box, you type HX3
the query for the first subform would say ' right then, I will show this record where the postcode is similar to what my mate wrote in the main form control called [postcode].
i.e.
postarea:
like [forms]![mainform]![postcode]
anyotherinfo:
rep name, product name etc..
ok, subform1 query set and functioning...
now for subform2
this query could be based on selections made in the subform1..
i.e.
repname:
like [forms]![mainform]![subform1]![repname?]
anyotherinfo:
repmobilenumber, or address etc..
now,
in the afterupdate event of the [postcode] text box, you need to type the following..
basically, when you enter a postcode in the main form, query 1 goes away and checks the data, if it finds owt, it
displays it.
then query 2 checks the contents of subform1 i.e. the reps name and displays the information that you need based on that info...
If you use wildcards, then yes, all your records will show. try not to use wildcards.
craig@chyld.co.uk
it wasn't falling that was embarrassing, it was realising that I hadn't tied my shoelaces in the first place.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.