Re: Use crosstab column heading in a calculation
- From: "Bill R via AccessMonster.com" <u9289@uwe>
- Date: Wed, 18 Jan 2006 19:18:53 GMT
Duane,
I found a thread that purports to have solved the problem, but I can't seem
to make it work. Here's the thread:
http://www.accessmonster.com/Uwe/Forum.aspx/access-formscoding/24422/Display-crosstab-query-in-subform#5a8dd03e6294fuwe
Here's my code in the On Current event of the main form:
Private Sub Form_Current()
Dim strSQL As String
Dim db As DAO.Database
Dim qdf As QueryDef
Set db = CurrentDb
strSQL = "PARAMETERS [Forms]![frmSwaps]![SwapID] Long, [Forms]![frmSwaps]!
[Conf95] IEEEDouble;" & vbCrLf
strSQL = strSQL & "TRANSFORM ..." & vbCrLf
strSQL = strSQL & "SELECT ..." & vbCrLf
strSQL = strSQL & "FROM tblSwapParameters AS Params, Params2" & vbCrLf
strSQL = strSQL & "WHERE swapid=[Forms]![frmSwaps]![SwapID]" & vbCrLf
strSQL = strSQL & "GROUP BY swapid, ..." & vbCrLf
strSQL = strSQL & "PIVOT CalcMonth;"
Set qdf = db.QueryDefs("qryFwdPrices")
qdf.SQL = strSQL
Me!sfrmFwdPrices.SourceObject = "Query.qryFwdPrices"
Set db = Nothing
End Sub
Can you see where I have strayed from Jesper's example?
Thanks,
Bill
Duane Hookom wrote:
>You don't ask for much do you ;-)
>
>You can only show records in a subform where you know the fields so you can
>set the control sources. I have not seen solutions for dynamic subforms. I
>have created solutions for dynamic fields in reports.
>
>I do create a somewhat dynamic subform in the Query By Form applet available
>for download at
>http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane
>
>> Duane,
>>
>[quoted text clipped - 17 lines]
>>>>>>>>>
>>>>>>>>> Bill
--
Bill Reed
"If you can't laugh at yoursel, laugh at somebody else"
Message posted via http://www.accessmonster.com
.
- Follow-Ups:
- Re: Use crosstab column heading in a calculation
- From: Duane Hookom
- Re: Use crosstab column heading in a calculation
- References:
- Use crosstab column heading in a calculation
- From: Bill R via AccessMonster.com
- RE: Use crosstab column heading in a calculation
- From: Bill R via AccessMonster.com
- RE: Use crosstab column heading in a calculation
- From: Bill R via AccessMonster.com
- Re: Use crosstab column heading in a calculation
- From: Duane Hookom
- Re: Use crosstab column heading in a calculation
- From: Bill R via AccessMonster.com
- Re: Use crosstab column heading in a calculation
- From: Duane Hookom
- Re: Use crosstab column heading in a calculation
- From: Bill R via AccessMonster.com
- Re: Use crosstab column heading in a calculation
- From: Duane Hookom
- Use crosstab column heading in a calculation
- Prev by Date: Re: Multiple combo boxes - send parameters to a query?
- Next by Date: Re: Records not showing in query
- Previous by thread: Re: Use crosstab column heading in a calculation
- Next by thread: Re: Use crosstab column heading in a calculation
- Index(es):
Relevant Pages
|