A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

transfer subform data into unbound excel sheet



 
 
Thread Tools Display Modes
  #1  
Old September 11th, 2006, 06:11 AM posted to microsoft.public.access.forms
anil
external usenet poster
 
Posts: 56
Default transfer subform data into unbound excel sheet

hi all
I want to transfer data from subform(in datasheet view ) in to excel
sheet (as unbound control).Is there any easy way to do it.
My subform is based on query and the data in subform is filtered data
using combo box in form.i.e. from combobox I select a particular
'Location' and I get data in subform for that particular Location.
Now I have excel chart embeded as unbound object frame in the form.I
want to transfer the subform data into that chart( or sheet ) so that I
can analyse the data.
I have tried one code as
Private Sub Form_Current()
Dim R As DAO.Recordset, X1 As Object ,pointer as integer
Set X1 = CreateObject("Excel.sheet.5")
Set R = Me.ExcelTestsubform.Form.RecordsetClone
pointer = 1
R.MoveFirst
Do Until R.EOF
X1.Cells(pointer, "A").Value = R.Fields("Location")
R.MoveNext
pointer = pointer + 1
Loop
X1.Cells(pointer, "A").Formula = "=Geomean(A1:A" & pointer - 1 &
")"
Me.Geomean = X1.Cells(pointer, "A").Value
End Sub

But it keeps giving me error at
"X1.Cells(pointer, "A").Value = R.Fields("Location")"

can some help me if If I can actually do it and if the module used is
in right direction.
Thanks
anil

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.