Re: Use crosstab column heading in a calculation

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



You can use a reference to a control on a form in the same way that you
would hard-code a value. As I stated earlier, crosstabs expect you to
identify the data types of all parameters.

--
Duane Hookom
MS Access MVP
--

"Bill R via AccessMonster.com" <u9289@uwe> wrote in message
news:5a8b11974c13f@xxxxxx
> Duane,
>
> Now that I've got the simple calculation working, is it possible to
> include a
> value from a control on a form in the calculation "Expr1"? What are the
> restrictions on calculations in a crosstab query? I've already come across
> a
> problem in using a control on the main form as criteria in a crosstab
> query
> or even in an underlying query for a crosstab query.
>
> If I can't use data from a control on a form, I will fall back to "Plan I"
> and run a make table query based on this crosstab query, and then populate
> the records and fields using a calculation in VBA.
>
> Thanks,
>
> Bill
>
> Duane Hookom wrote:
>>You must always define the data type of all parameters in crosstab
>>queries.
>>Select Query->Parameters and enter
>>[Forms]![frmSwaps]![txtSwapID] datatype
>>
>>BTW: without reading all your other postings, the solution for your first
>>posting is to create a query with this sql
>>TRANSFORM
>>First([tblSwapParameters].[SpotMonth]*[tblSwapParameters_1].[SpotMonth])
>>AS
>>Expr1
>>SELECT tblSwapParameters.SpotMonth
>>FROM tblSwapParameters, tblSwapParameters AS tblSwapParameters_1
>>GROUP BY tblSwapParameters.SpotMonth
>>PIVOT tblSwapParameters_1.SpotMonth;
>>
>>> PS:
>>>
>>[quoted text clipped - 42 lines]
>>>>>>
>>>>>> Bill
>
> --
> Bill Reed
>
> "If you can't laugh at yoursel, laugh at somebody else"
>
> Message posted via http://www.accessmonster.com


.



Relevant Pages

  • RE: Calculated Field
    ... > Try moving the formula to the query, still using the dlookup, add an index to ... > use the query fields in the subform to feed the criteria in the dlookup ... >> I place an unbound control on the subform and set its control source to do ... >> the calculation. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Getting an UnBound control value into a Table field??????
    ... I will need to store the number of parts in the test and the amount of time ... As Jeff suggests, put the calculation into a query, and use the query ... If I bind my control to the Table, I can't have the control calculate the ...
    (microsoft.public.access.forms)
  • Re: Getting an UnBound control value into a Table field??????
    ... I gave a lot of consideration to the Query but couldn't find any information ... On the other hand, if the calculation is ALWAYS the same, why bother storing ... I created a drop down list for selecting the "Study Type" as listed above. ... I had to put this under Control Source to make it work, ...
    (microsoft.public.access.forms)
  • Re: Update query
    ... > any calculation will be MUCH faster than a disk fetch); ... > in the control source of a Form or a Report textbox. ... > query joining the two tables on that field. ... Update LOSAdmitSurg to ...
    (microsoft.public.access.queries)
  • RE: Update table field from expression in form
    ... "AusTexRich" wrote: ... Are you wanting to do this on a form, in a query, or in recordset processing? ... you will need a Text Box control on your form bound to the field. ... Then assign the result of the calculation to the bound control. ...
    (microsoft.public.access.forms)