Query help

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

I have a form with (2) textboxes StartDate & EndDate also a command button.
When the command button is pressed a query captures the (2) dates and then
displays the correct results. I would like to see the results in a listbox
instead of a query window. The code behind the button is wizard created:

DoCmd.OpenQuery "Qcalendar", acViewNormal

Thanks
 
=?Utf-8?B?UmljaGFyZA==?= said:
I have a form with (2) textboxes StartDate & EndDate also a command button.
When the command button is pressed a query captures the (2) dates and then
displays the correct results. I would like to see the results in a listbox
instead of a query window. The code behind the button is wizard created:

DoCmd.OpenQuery "Qcalendar", acViewNormal

Thanks

Let the query be the RowSource of your listbox and change the code
behind the button to:
Me.YourListbox.Requery
 
Why do you want to see the resukts in a listbox? Do you want to select an
item i the listbox and do something else?

Steve
(e-mail address removed)
 
I have a form with (2) textboxes StartDate & EndDate also a command button.
When the command button is pressed a query captures the (2) dates and then
displays the correct results. I would like to see the results in a listbox
instead of a query window. The code behind the button is wizard created:

DoCmd.OpenQuery "Qcalendar", acViewNormal

Thanks

In that case, don't open the query at all; instead, set the Listbox's
Rowsource property to the name of the query:

Me!listboxname.RowSource = "QCalendar"

You might need to then requery the listbox.
 
Back
Top