Form with listbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all,

I have a form with tabs on it. On a couple of the tabs I have listbox's
tied to a query. Is there a way to have the query not to run when it
(access) is opened?

One of the queries takes a while, so I would rather it run the requery once
I select the tab.

I thought maybe making the listbox.visible = false would stop it but it does
not.

Thanks!
 
Hi Mark,

I personally set the recordsource of the listbox in design view to a select
statement that will never return any records

e.g.

"Select * from TblTest Where myID=-1"

making sure that nothing is returned.

then put the correct select statement in the recordsource, when you click on
the tab.
 
Thanks, that will work!

Alex White MCDBA MCSE said:
Hi Mark,

I personally set the recordsource of the listbox in design view to a select
statement that will never return any records

e.g.

"Select * from TblTest Where myID=-1"

making sure that nothing is returned.

then put the correct select statement in the recordsource, when you click on
the tab.


--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 
I am not sure why you need a Query / SQL String to return an empty
Recordset.

I simply leave the RowSource Property of the ListBox empty and set the
RowSource when the Tab is selected.
 
I personally do this to get the formatting of the listbox correct, but yes
your right after that point you could just delete the rowsource string
completely.
 
Back
Top