S
smile
If I have a report or form based on 3 queries:
1st query pulls data from table or multiple tables and filter by criteria
(for example date interval)
2nd query is based on 1st - it is a total query that calculates sum
3rd query is based on 2nd query - it converts numbers to words by using a
module VBA code.
The problem:
When I open report or form with all 3 queries in i what access does behind
the hood?
1.
all queries are executed once.
2.
1st query populates detail section of the report
2nd query populates total sum field but also runs query 1?
3rd query populates numbers to words field but also runs queries 1 and 2?
I tried to use unbound textboxes, and I ran into these problems:
1. Unbound textbox takes 1 to 1.5 seconds delay to load on any report or form.
2. If I have unbound texbox 1 that creates total sum and unbound textbox2
that calculates numbers to words from 1st textbox I have a problem:
textbox 2 sometimes fails because textbox 1 encounters delay (for example
many records etc.)
It seems that unbound text box fires formula and does not wait for "source"
to provide data. If the source control does not have ready data then it fails
or in the case where I need to convert number to words gives me debug error
because integer is empty sometimes etc.
3. I have some reports designed with summary only, I need calculated total
but do not have any records visible. So I do calculations in second totals
query. Because totals query does not always like expressions (don't know why
this is but if I need to have data in currency format I have a formula like
I entered:
total: Nz([sumof_myfieldname];0)
but no zero if my value is null.
your code genreates this sql:
SELECT Sum(Nz([SumOf_myfieldname],0)) AS total
FROM my_query_ name_group;
my working sql but shown as expression:
SELECT CCur(Nz(Sum(my_query_ name_group.SumOf_myfieldname),0)) AS total
FROM my_query_ name_group;
I would like to avoid using expression
) I have third query to convert number to words.
Any thoughts are welcome
1st query pulls data from table or multiple tables and filter by criteria
(for example date interval)
2nd query is based on 1st - it is a total query that calculates sum
3rd query is based on 2nd query - it converts numbers to words by using a
module VBA code.
The problem:
When I open report or form with all 3 queries in i what access does behind
the hood?
1.
all queries are executed once.
2.
1st query populates detail section of the report
2nd query populates total sum field but also runs query 1?
3rd query populates numbers to words field but also runs queries 1 and 2?
I tried to use unbound textboxes, and I ran into these problems:
1. Unbound textbox takes 1 to 1.5 seconds delay to load on any report or form.
2. If I have unbound texbox 1 that creates total sum and unbound textbox2
that calculates numbers to words from 1st textbox I have a problem:
textbox 2 sometimes fails because textbox 1 encounters delay (for example
many records etc.)
It seems that unbound text box fires formula and does not wait for "source"
to provide data. If the source control does not have ready data then it fails
or in the case where I need to convert number to words gives me debug error
because integer is empty sometimes etc.
3. I have some reports designed with summary only, I need calculated total
but do not have any records visible. So I do calculations in second totals
query. Because totals query does not always like expressions (don't know why
this is but if I need to have data in currency format I have a formula like
I entered:
total: Nz([sumof_myfieldname];0)
but no zero if my value is null.
your code genreates this sql:
SELECT Sum(Nz([SumOf_myfieldname],0)) AS total
FROM my_query_ name_group;
my working sql but shown as expression:
SELECT CCur(Nz(Sum(my_query_ name_group.SumOf_myfieldname),0)) AS total
FROM my_query_ name_group;
I would like to avoid using expression
) I have third query to convert number to words.
Any thoughts are welcome