I want to base a form on a crosstab query. The query shows statistics
for a user defined period. The column headings will look something
like this:
ClientID Month01 Month02 Month03 etc..
So if the user selects 3 months in the criteria form, there will be 3
(month) column headings, if he selects 6 months, the will be 6
headings.
At the moment my solution is to somehow (i haven't figured out the VBA
yet) construct a form dynamically. Is there a simpler solution to this
problem?
Thanks,
Paul 8 5857
On Apr 29, 2:33*am, Paul H <goo...@comcraft.freeserve.co.ukwrote:
I want to base a form on a crosstab query. The query shows statistics
for a user defined period. The column headings will look something
like this:
ClientID * Month01 *Month02 *Month03 *etc..
So if the user selects 3 months in the criteria form, there will be 3
(month) column headings, if he selects 6 months, the will be 6
headings.
At the moment my solution is to somehow (i haven't figured out the VBA
yet) construct a form dynamically. Is there a simpler solution to this
problem?
Thanks,
Paul
assuming that there will be a maximum of 12 months
edit the query, hilight the column heading field, I assume it is
called 'months' and show its properties (right click the column)
in the 'column headings' property add
"month01", "month02", ..., "month12"
this will cause the query to already have 12 columns regardless of
which, if any, have data
On 29 Apr, 11:07, Roger <lesperan...@natpro.comwrote:
On Apr 29, 2:33*am, Paul H <goo...@comcraft.freeserve.co.ukwrote:
I want to base a form on a crosstab query. The query shows statistics
for a user defined period. The column headings will look something
like this:
ClientID * Month01 *Month02 *Month03 *etc..
So if the user selects 3 months in the criteria form, there will be 3
(month) column headings, if he selects 6 months, the will be 6
headings.
At the moment my solution is to somehow (i haven't figured out the VBA
yet) construct a form dynamically. Is there a simpler solution to this
problem?
Thanks,
Paul
assuming that there will be a maximum of 12 months
edit the query, hilight the column heading field, I assume it is
called 'months' and show its properties (right click the column)
in the 'column headings' property add
* *"month01", "month02", ..., "month12"
this will cause the query to already have 12 columns regardless of
which, if any, have data- Hide quoted text -
- Show quoted text -
Roger,
Thank you...I should have explained in more detail:
The crosstab query actually shows the number of issues of a magazine
that have been delivered to customers, by issue date, between two user
selectable dates. So the crosstab query actually looks like this:
ClientID 01/01/2007 01/02/2007 01/03/2007 etc..
B&Q 55 110 110
Halfords 110 110 110
Notice that the column headings represent the issue date, also, some
months the magazine may not be published at all, so unfortunately your
solution will not work.
Paul
Paul H wrote:
On 29 Apr, 11:07, Roger <lesperan...@natpro.comwrote:
>>On Apr 29, 2:33 am, Paul H <goo...@comcraft.freeserve.co.ukwrote:
>>>I want to base a form on a crosstab query. The query shows statistics for a user defined period. The column headings will look something like this:
>>>ClientID Month01 Month02 Month03 etc..
>>>So if the user selects 3 months in the criteria form, there will be 3 (month) column headings, if he selects 6 months, the will be 6 headings.
>>>At the moment my solution is to somehow (i haven't figured out the VBA yet) construct a form dynamically. Is there a simpler solution to this problem?
>>>Thanks,
>>>Paul
assuming that there will be a maximum of 12 months edit the query, hilight the column heading field, I assume it is called 'months' and show its properties (right click the column) in the 'column headings' property add "month01", "month02", ..., "month12"
this will cause the query to already have 12 columns regardless of which, if any, have data- Hide quoted text -
- Show quoted text -
Roger,
Thank you...I should have explained in more detail:
The crosstab query actually shows the number of issues of a magazine
that have been delivered to customers, by issue date, between two user
selectable dates. So the crosstab query actually looks like this:
ClientID 01/01/2007 01/02/2007 01/03/2007 etc..
B&Q 55 110 110
Halfords 110 110 110
Notice that the column headings represent the issue date, also, some
months the magazine may not be published at all, so unfortunately your
solution will not work.
Paul
The following link is for a report. But I'm sure you can modify it for
a continuous form. http://www.fmsinc.com/tpapers/access...hly/index.html
Flight http://www.youtube.com/watch?v=LtnDUSJfbzU
On 29 Apr, 14:20, Salad <o...@vinegar.comwrote:
Paul H wrote:
On 29 Apr, 11:07, Roger <lesperan...@natpro.comwrote:
>On Apr 29, 2:33 am, Paul H <goo...@comcraft.freeserve.co.ukwrote:
>>I want to base a form on a crosstab query. The query shows statistics for a user defined period. The column headings will look something like this:
>>ClientID * Month01 *Month02 *Month03 *etc..
>>So if the user selects 3 months in the criteria form, there will be 3 (month) column headings, if he selects 6 months, the will be 6 headings.
>>At the moment my solution is to somehow (i haven't figured out the VBA yet) construct a form dynamically. Is there a simpler solution to this problem?
>>Thanks,
>>Paul
>assuming that there will be a maximum of 12 months edit the query, hilight the column heading field, I assume it is called 'months' and show its properties (right click the column) in the 'column headings' property add
* "month01", "month02", ..., "month12"
>this will cause the query to already have 12 columns regardless of which, if any, have data- Hide quoted text -
>- Show quoted text -
Roger,
Thank you...I should have explained in more detail:
The crosstab query actually shows the number of issues of a magazine
that have been delivered to customers, by issue date, between two user
selectable dates. So the crosstab query actually looks like this:
ClientID * *01/01/2007 *01/02/2007 *01/03/2007 *etc..
B&Q * * * * * * 55 * * * * * * *110 * * * * * * 110
Halfords * * * *110 * * * * * * 110 * * * * * * 110
Notice that the column headings represent the issue date, also, some
months the magazine may not be published at all, so unfortunately your
solution will not work.
Paul
The following link is for a report. *But I'm sure you can modify it for
a continuous form.http://www.fmsinc.com/tpapers/access...hly/index.html
Flighthttp://www.youtube.com/watch?v=LtnDUSJfbzU- Hide quoted text -
- Show quoted text -
Salad, Thank you for your reply.
I noticed in the text it says:
"Microsoft Access reports reference field names directly. If we want
to use a crosstab query as the RecordSource of a report, its column
names should not change (unless we want to write a lot of code to
handle that)."
Considering the fact that my users may select any number of months, am
I screwed? Have I got to write a load of code to dynamically create my
form?
:O(
Paul
"Paul H" <go****@comcraft.freeserve.co.ukwrote in message
news:94**********************************@a1g2000h sb.googlegroups.com...
On 29 Apr, 14:20, Salad <o...@vinegar.comwrote:
Paul H wrote:
On 29 Apr, 11:07, Roger <lesperan...@natpro.comwrote:
>On Apr 29, 2:33 am, Paul H <goo...@comcraft.freeserve.co.ukwrote:
>>I want to base a form on a crosstab query. The query shows statistics for a user defined period. The column headings will look something like this:
>>ClientID Month01 Month02 Month03 etc..
>>So if the user selects 3 months in the criteria form, there will be 3 (month) column headings, if he selects 6 months, the will be 6 headings.
>>At the moment my solution is to somehow (i haven't figured out the VBA yet) construct a form dynamically. Is there a simpler solution to this problem?
>>Thanks,
>>Paul
>assuming that there will be a maximum of 12 months edit the query, hilight the column heading field, I assume it is called 'months' and show its properties (right click the column) in the 'column headings' property add
"month01", "month02", ..., "month12"
>this will cause the query to already have 12 columns regardless of which, if any, have data- Hide quoted text -
>- Show quoted text -
Roger,
Thank you...I should have explained in more detail:
The crosstab query actually shows the number of issues of a magazine
that have been delivered to customers, by issue date, between two user
selectable dates. So the crosstab query actually looks like this:
ClientID 01/01/2007 01/02/2007 01/03/2007 etc..
B&Q 55 110 110
Halfords 110 110 110
Notice that the column headings represent the issue date, also, some
months the magazine may not be published at all, so unfortunately your
solution will not work.
Paul
The following link is for a report. But I'm sure you can modify it for
a continuous
form. http://www.fmsinc.com/tpapers/access...hly/index.html
>
Flighthttp://www.youtube.com/watch?v=LtnDUSJfbzU- Hide quoted text -
- Show quoted text -
Salad, Thank you for your reply.
I noticed in the text it says:
"Microsoft Access reports reference field names directly. If we want
to use a crosstab query as the RecordSource of a report, its column
names should not change (unless we want to write a lot of code to
handle that)."
Considering the fact that my users may select any number of months, am
I screwed? Have I got to write a load of code to dynamically create my
form?
:O(
Paul
Will your user select any number of months? Or will there be some limit, 12,
24, 36 ect. Access has limits on report/form width and control count. Once
you define the max number of months you can use Salad's posting to help
create your query and report(s).
Paul H wrote:
On 29 Apr, 14:20, Salad <o...@vinegar.comwrote:
>>Paul H wrote:
>>>On 29 Apr, 11:07, Roger <lesperan...@natpro.comwrote:
>>>>On Apr 29, 2:33 am, Paul H <goo...@comcraft.freeserve.co.ukwrote:
>>>>>I want to base a form on a crosstab query. The query shows statistics >for a user defined period. The column headings will look something >like this:
>>>>>ClientID Month01 Month02 Month03 etc..
>>>>>So if the user selects 3 months in the criteria form, there will be 3 >(month) column headings, if he selects 6 months, the will be 6 >headings.
>>>>>At the moment my solution is to somehow (i haven't figured out the VBA >yet) construct a form dynamically. Is there a simpler solution to this >problem?
>>>>>Thanks,
>>>>>Paul
>>>>assuming that there will be a maximum of 12 months edit the query, hilight the column heading field, I assume it is called 'months' and show its properties (right click the column) in the 'column headings' property add "month01", "month02", ..., "month12"
>>>>this will cause the query to already have 12 columns regardless of which, if any, have data- Hide quoted text -
>>>>- Show quoted text -
>>>Roger,
>>>Thank you...I should have explained in more detail:
>>>The crosstab query actually shows the number of issues of a magazine that have been delivered to customers, by issue date, between two user selectable dates. So the crosstab query actually looks like this:
>>>ClientID 01/01/2007 01/02/2007 01/03/2007 etc.. B&Q 55 110 110 Halfords 110 110 110
>>>Notice that the column headings represent the issue date, also, some months the magazine may not be published at all, so unfortunately your solution will not work.
>>>Paul
The following link is for a report. But I'm sure you can modify it for a continuous form.http://www.fmsinc.com/tpapers/access...hly/index.html
Flighthttp://www.youtube.com/watch?v=LtnDUSJfbzU- Hide quoted text -
- Show quoted text -
Salad, Thank you for your reply.
I noticed in the text it says:
"Microsoft Access reports reference field names directly. If we want
to use a crosstab query as the RecordSource of a report, its column
names should not change (unless we want to write a lot of code to
handle that)."
Ron's reponse was spot on. You REALLY need to study the article to
understand it. It is an excellent article on displaying crosstab data.
Considering the fact that my users may select any number of months, am
I screwed? Have I got to write a load of code to dynamically create my
form?
:O(
Paul
If you want to give your users real flexibility I suppose you can open
up a form in design mode and write a bunch of code to create the form's
controls. But in crosstabs, afaic, that's nuts. Give your users an
acceptable time frame; 12 months; 24 months, whatever. Then work within
your format.
Hanging Out http://www.youtube.com/watch?v=hiFOvrDAxxw
Paul H <go****@comcraft.freeserve.co.ukwrote in
news:94ede0d0-61eb-459d-b875- 50**********@a1g2000hsb.googlegroups.com
>
Considering the fact that my users may select any number of
months, am I screwed? Have I got to write a load of code to
dynamically create my form?
:O(
Paul
Sometimes you have to compromise. Instead of allowing them to choose
a start date and end date, have them choose a start date and a
number of following months, say 3, 6 or 12.
By limiting the number of choices to a reasonable set of options,
you have mead it easier for them to decide what report to generate,
and easier for you to give them those reports.
The next step is to code the periods in the query to a number, so
say you've decided they will get 12 month reports, you set the first
month to 0, the second to 1, and so on to 11.
So your query contains the following columns:
RptStartDate,
ClientId,
datediff("m",rptStartDate,[Issue Date]) as monthOffset,
Count(delivery) as NumDeliveries.
In the report, you can set the column header labels to a Date using
dateadd("m",monthoffset, rptStartDate)
The report will look and feel like the dates were the actual column
headers.
There is a way to have columns appear in a crosstab even if there is
no data so that you just get a blank column if the magazine is only
published bi-monthly.
--
Bob Quintal
PA is y I've altered my email address.
** Posted from http://www.teranews.com **
Thanks to all who posted.
I have agreed with the client that he can view the results for a 6
month period only.
Paul
On 29 Apr, 09:33, Paul H <goo...@comcraft.freeserve.co.ukwrote:
I want to base a form on a crosstab query. The query shows statistics
for a user defined period. The column headings will look something
like this:
ClientID * Month01 *Month02 *Month03 *etc..
So if the user selects 3 months in the criteria form, there will be 3
(month) column headings, if he selects 6 months, the will be 6
headings.
At the moment my solution is to somehow (i haven't figured out the VBA
yet) construct a form dynamically. Is there a simpler solution to this
problem?
Thanks,
Paul
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Donna Sabol |
last post by:
First, I should start by saying I am creating a database to be used by
some very impatient, non-computer literate people. It needs to be
seameless in it's operation from their point of view. I...
|
by: Matthew Wells |
last post by:
I have a crosstab query based on anothe query. The base query resultset has
no null values in its "Quantity" column. However, when I create the new
crosstab query from the base query, the records...
|
by: Mike |
last post by:
Is it possible to create and display a form based on a string variable that
will be set at run-time?
In other words, instead of declaring a variable as a user-defined form
class:
Dim MyForm...
|
by: john |
last post by:
I created a form via the wizard with 1 main table and 2 one-on-one tables.
As i couldn't add a field to the form (a field that I added to the table
after creating the form), I googled out that the...
|
by: Metalzed |
last post by:
I have 4 tabels
tbOWNERS // PLAYERS
ID , NAME
1 Mike
2 Rambo
3 Sam
tbCARS // CARS THAT EXIST AND WHO OWNS THEM
|
by: starke1120 |
last post by:
Is there a way to open a form based on query type.. Example..
If a certain query result is 1 then open the form to this result..
If the query results are NULL or 0 results, then open open for...
|
by: Matsam |
last post by:
Hello,
I have an Access form having 3 combos. I need to run a crosstab query when clicking a button in the form. But I want to include the values of the combo boxes in the filter condition of the...
|
by: serhii7777 |
last post by:
Hello, I am building a database that keeps track of some events. I need to plot the events on a map. In other words, a query returns a number - digit, the number of incidents of a particular kind. I...
|
by: dgunner71 |
last post by:
All,
I have a Parent form where the Record Source is a query based on three tables (tblcustomers, tblEquipment, and tblWorkOrders).
The Parent form has a subform based on a 4th table...
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |