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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Fill Combo Box with dates without query?



 
 
Thread Tools Display Modes
  #1  
Old January 2nd, 2008, 09:55 PM posted to microsoft.public.access.forms
Jon
external usenet poster
 
Posts: 23
Default Fill Combo Box with dates without query?

I have a combo box that takes a good deal of time to fill... I have an
idea on how to speed it up but I'm not sure how to go about creating
the query/VBA to do the job.

The query that populates the combo box is:

SELECT qryMonthID.FullID, qryMonthID.YearID, qryMonthID.MonthNameID,
qryMonthID.SortID, qryMonthID.MonthID FROM qryMonthID;

With only FullID as being visible, and the qryMonthID behind that is
this:

SELECT DISTINCT Year([purchase_dte]) AS YearID,
FORMAT([purchase_dte],"mmmm") AS MonthNameID,
FORMAT([purchase_dte],"mmm/yy") AS FullID,
FORMAT([purchase_dte],"yyyymm") AS SortID, Month([purchase_dte]) AS
MonthID
FROM tblPurchaseOrders
ORDER BY FORMAT([purchase_dte],"yyyymm");

The problem I am having is that I have users who are complaining about
how long the combo box takes to activate, which is due to the number
of entries in tblPurchaseOrders having grown very rapidly lately.

Now I already have both the minimum and maximum values for
purchase_dte in memory as global variables since theyr'e needed for
some other searches. Can someone help me out by showing me how I can
fill the combo box with the needed dates using only those two values?
  #2  
Old January 2nd, 2008, 10:54 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Fill Combo Box with dates without query?

One approach to doing this would be to create a couple functions that return
those global variables. Then you could use those functions in a query, in
the Selection Criterion "cell", with something like:
Between Function1() And Function2().

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Jon" wrote in message
...
I have a combo box that takes a good deal of time to fill... I have an
idea on how to speed it up but I'm not sure how to go about creating
the query/VBA to do the job.

The query that populates the combo box is:

SELECT qryMonthID.FullID, qryMonthID.YearID, qryMonthID.MonthNameID,
qryMonthID.SortID, qryMonthID.MonthID FROM qryMonthID;

With only FullID as being visible, and the qryMonthID behind that is
this:

SELECT DISTINCT Year([purchase_dte]) AS YearID,
FORMAT([purchase_dte],"mmmm") AS MonthNameID,
FORMAT([purchase_dte],"mmm/yy") AS FullID,
FORMAT([purchase_dte],"yyyymm") AS SortID, Month([purchase_dte]) AS
MonthID
FROM tblPurchaseOrders
ORDER BY FORMAT([purchase_dte],"yyyymm");

The problem I am having is that I have users who are complaining about
how long the combo box takes to activate, which is due to the number
of entries in tblPurchaseOrders having grown very rapidly lately.

Now I already have both the minimum and maximum values for
purchase_dte in memory as global variables since theyr'e needed for
some other searches. Can someone help me out by showing me how I can
fill the combo box with the needed dates using only those two values?



  #3  
Old January 3rd, 2008, 06:10 PM posted to microsoft.public.access.forms
Jon
external usenet poster
 
Posts: 23
Default Fill Combo Box with dates without query?

That suggestion did the trick. Thank you!

On Jan 2, 5:54*pm, "Jeff Boyce" wrote:
One approach to doing this would be to create a couple functions that return
those global variables. *Then you could use those functions in a query, in
the Selection Criterion "cell", with something like:
* * *Between Function1() And Function2().

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Jon" wrote in message

...



I have a combo box that takes a good deal of time to fill... I have an
idea on how to speed it up but I'm not sure how to go about creating
the query/VBA to do the job.


The query that populates the combo box is:


SELECT qryMonthID.FullID, qryMonthID.YearID, qryMonthID.MonthNameID,
qryMonthID.SortID, qryMonthID.MonthID FROM qryMonthID;


With only FullID as being visible, and the qryMonthID behind that is
this:


SELECT DISTINCT Year([purchase_dte]) AS YearID,
FORMAT([purchase_dte],"mmmm") AS MonthNameID,
FORMAT([purchase_dte],"mmm/yy") AS FullID,
FORMAT([purchase_dte],"yyyymm") AS SortID, Month([purchase_dte]) AS
MonthID
FROM tblPurchaseOrders
ORDER BY FORMAT([purchase_dte],"yyyymm");


The problem I am having is that I have users who are complaining about
how long the combo box takes to activate, which is due to the number
of entries in tblPurchaseOrders having grown very rapidly lately.


Now I already have both the minimum and maximum values for
purchase_dte in memory as global variables since theyr'e needed for
some other searches. Can someone help me out by showing me how I can
fill the combo box with the needed dates using only those two values?- Hide quoted text -


- Show quoted text -


 




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 11:46 PM.


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