Prev: Store info for reports from switchboard
Next: Selecting the last 10 records from a specific date
From: Richard on 1 Jun 2010 23:48 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
From: XPS35 on 2 Jun 2010 02:46 =?Utf-8?B?UmljaGFyZA==?= wrote: > > 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 -- Groeten, Peter http://access.xps350.com
From: Steve on 2 Jun 2010 10:16 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 santus(a)penn.com "Richard" <Richard(a)discussions.microsoft.com> wrote in message news:54F193A2-5A74-4818-A24C-391DBBE4D630(a)microsoft.com... >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
From: John W. Vinson on 3 Jun 2010 12:53 On Tue, 1 Jun 2010 20:48:01 -0700, Richard <Richard(a)discussions.microsoft.com> wrote: >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. -- John W. Vinson [MVP]
|
Pages: 1 Prev: Store info for reports from switchboard Next: Selecting the last 10 records from a specific date |