Prevent List Box from Requerying

  • Thread starter Thread starter Mike Thomas
  • Start date Start date
M

Mike Thomas

In Access 2000 I have a form with a list box with a row source of "GetBoxes"
; a query.

I would like to not have the box display any records unless the user clicks
a button on the form.

Is it possible the set the form's row source property to "Get Boxes", but to
only have the list box requeried when the user clicks the button?
(Me.lstBox.requery).

Many thanks
Mike Thomas
 
in message:
In Access 2000 I have a form with a list box with a row source of "GetBoxes"
; a query.

I would like to not have the box display any records unless the user clicks
a button on the form.

Is it possible the set the form's row source property to "Get Boxes", but to
only have the list box requeried when the user clicks the button?
(Me.lstBox.requery).

Many thanks
Mike Thomas

Hi Mike,

On the list box properties list set these accordingly:
Row Source Type: Table/Query
Row Source: (do not put anything here, just blank)
Column Widths: Set as you need them here
Bound Column: Whatever one you need

I'm assuming as you stated you have a saved query called GetBoxes.

When the form opens the list box will be completely blank.

Now here is some code behind a command button:

Private Sub cmdFillListBox_Click()
Me.lstMyListBox.RowSource = "GetBoxes"
End Sub

Clicking the button will fill the list box with the query information.
 
Back
Top