newbie select query in form problem

  • Thread starter Thread starter Cesar Zapata
  • Start date Start date
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.
 
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
 
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!
 
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.
 
Back
Top