A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query help



 
 
Thread Tools Display Modes
  #1  
Old June 2nd, 2010, 04:48 AM posted to microsoft.public.access.gettingstarted
Richard
external usenet poster
 
Posts: 1,419
Default Query help

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
Ads
  #2  
Old June 2nd, 2010, 07:46 AM posted to microsoft.public.access.gettingstarted
xps35
external usenet poster
 
Posts: 22
Default Query help

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

  #4  
Old June 3rd, 2010, 05:53 PM posted to microsoft.public.access.gettingstarted
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query help

On Tue, 1 Jun 2010 20:48:01 -0700, Richard
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]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2004-2017 OfficeFrustration.
The comments are property of their posters.