Query help

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
 
X

XPS35

=?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
 
S

Steve

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)
 
J

John W. Vinson

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.
 

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