I use two queries for the Statement system.
The first, the one I posted is just the one used for the ComboBox look
up,
to supply the parameters "AddressesID" and the month "mmmyy" which I plan
to
pass to the query used for the RptStatement and this one is QryInvoice.
But the problem is isolated to the first query (the one I posted) because
the combo box based on it will not return the fields selected for the text
fields on the statement pop-up form.
"=[Combo6].[Column](0)" and
"=[Combo6].[Column](2)"
These two ColumnProperties should return a Customer and its corresponding
month from a list as shown below, based on the combo I posted.
The following is an reduced example of the ComboBox display showing two
columns only:
Customer: Month:
NV Soap Aug05
NV Soap Jul05
NV Soap Jun05
NV Soap May05
MelCo Aug05
MelCo Jul05
SaltCo May05
SaltCo Apr05
SaltCo Feb05
If a record is selected from this combo, say (NVSoap, May05) then the
ColumnProperty will return only (NV Soap, Aug05) which is the top month.
Similarly if (SaltCo, Feb05) is selected then only (SaltCo, May05) is
returned!
In all cases all that is returned is the top month of a selected customer,
and this appears to be a problem with the Column Property.
message
I do most of mine in the design grid also, but the SQL is easier to paste
into a message.
I don't see any where in your query where you are referring to a control
on a form. Are you doing that in one of the queries that this query is
built on?
--
Wayne Morgan
MS Access MVP
Frank Martin said:
This is it, though I do all the designing via the query grid.
***
SELECT QryCustTRIALBALANCE.AddressesID, QryCustTRIALBALANCE.People,
QryCustTRIALBALANCE.Expr1, Sum(QryCustTRIALBALANCE.SumOfExpr3) AS
SumOfSumOfExpr3, QryCustTRIALBALANCE.Expr2
FROM QryCustTRIALBALANCE
GROUP BY QryCustTRIALBALANCE.AddressesID, QryCustTRIALBALANCE.People,
QryCustTRIALBALANCE.Expr1, QryCustTRIALBALANCE.Expr2
HAVING (((QryCustTRIALBALANCE.People)<>"Test company incorporated"))
ORDER BY QryCustTRIALBALANCE.People, QryCustTRIALBALANCE.Expr2 DESC;
***
Thanks.
message Will you post the query's SQL view?
--
Wayne Morgan
MS Access MVP
Thanks, I have gone over this again and the problem seems to be with
the column property.
I have done as you suggested and put two text boxes on the form, with
the intention of using these as the Statement query parameters.
However the same problem arises when putting the values into these
text
boxes.
For Text1 the expression is "=[Combo6].[Column](0)" and this returns
the customer names.
For Text2 the expression is "=[Combo6].[Column](2)" and this returns
the month in the format "mmmyy".
Text1 seems to work, though one cannot know which of the identical
customer names it returns (if one customer has transactions in several
months.)
Text2 returns only the latest month and ignors all the earlier ones.
I have never seen this problem before.
Regards, Frank