newbie select query in form problem

C

Cesar Zapata

Hi,

I'm trying to have a datasheet form based on a query in a subform.

The main form contains 3 unbound textboxed that will be used to
search. once they are filled I want to press a button then the query
will execute showing the results if any.


What I have now is the subforms loads up now as soon as I open the
form with all records and becuase the BackEnd is in a Share drive it
takes forever to load up.

so what I need is to not show anything but when I actually execute the
"Search" button.

is this possible?


thanks for your help.
 
D

Dale Fye

Absolutely!

-Go to your main form in design view.
-Select the subform and look at the SourceObject property on the Data tab of
the Properties window.
-Copy whatever is there (should be the actual name of the subform)
-Delete it so that it is blank
-Go to the format tab and set the visible property to False.

Then, in the code behind the search button, add two lines of code:

me.subFormControl.ControlSource = "put the subform name here, in quotes"
me.subFormControl.visible = true

HTH
Dale
 
C

Cesar Zapata

Absolutely!

-Go to your main form in design view.
-Select the subform and look at the SourceObject property on the Data tab of
the Properties window.
-Copy whatever is there (should be the actual name of the subform)
-Delete it so that it is blank
-Go to the format tab and set the visible property to False.

Then, in the code behind the search button, add two lines of code:

me.subFormControl.ControlSource = "put the subform name here, in quotes"
me.subFormControl.visible = true

HTH
Dale

--
Email address is not valid.
Please reply to newsgroup only.











- Show quoted text -

cool thanks. it works!

slowly to be only 1000 records but hey it works!
 
D

Dale Fye

If the query is slow, it probably has to do with your network, the way you
wrote your SQL, or the indexes on the underlying tables.
 

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