Row and column values for a pivottable?

S

spnxd0

I'm creating a pivottable form and the requirements are for the user t
be able to double click on a cell in the form and it should pop
dialog that would allow them to replace the data in that cell. I ca
do the data manipulation, it is similar to a previous form, but I nee
some more info from the pivottable first. How can I determine th
values for the rows and columns? I can get the value for the cell, bu
I also need to know what row and column that cell is from.

Here is my code so far:

If Me.CurrentView = acCurViewPivotTable Then

Dim sel As Object
Dim objPDetailRange As Object
Dim objPDetailCell As Object
Dim stDocName As String
Dim stLinkCriteria As String

' Get the selection.
Set sel = Me.PivotTable.Selection

If TypeName(sel) = "PivotDetailRange" Then

Set objPDetailRange = PivotTable.Selection
Set objPDetailCell = objPDetailRange.TopLeft
MsgBox objPDetailCell.Value

'stDocName = "ReplaceAssemblyPrototype"
'DoCmd.OpenForm stDocName, , , stLinkCriteria
End If ' typename(sel) = "PivotDetailRange"

End If ' Me.CurrentView = acCurViewPivotTabl
 
A

Alvin Bruney - ASP.NET MVP

An alternative way to do this is to map a client-side dialog to the
double-click event using javascript. Next, you would handle the pivot table
double-click event or you can use the rangefrompoint method to determine
what is under the cursor (or your peice of selection code may be used here
as well)

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top