468,505 Members | 1,655 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,505 developers. It's quick & easy.

data transfer from access to excel

7
Hi everyone.
My question is that i have a form which includes subform,too. in this form for example i choose a country and in the subform its capital, currency,president are shown. and i have a button to transfer infos to the excel. the problem is here. because when i click, it doesn't send infos from subform,it sends whole country's infos. how can i solve this?

thanks
Feb 7 '07 #1
6 2370
okan
7
can anybody help me please?
Feb 7 '07 #2
Rabbit
12,513 Expert Mod 8TB
First, have patience because there are posts earlier than yours that should be answered first. The people here are volunteering their time.

Second, you say your code isn't working but you didn't paste your code so we can see where it went wrong.
Feb 7 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
Hi everyone.
My question is that i have a form which includes subform,too. in this form for example i choose a country and in the subform its capital, currency,president are shown. and i have a button to transfer infos to the excel. the problem is here. because when i click, it doesn't send infos from subform,it sends whole country's infos. how can i solve this?

thanks
As far as I know you can't output the subform record without the main form record. However, as Rabbit says post the code you are using and we'll see if there if an alternative.
Feb 8 '07 #4
NeoPa
32,094 Expert Mod 16PB
Let me post in two parts :

First as a moderator.
As Rabbit said, please do not post your impatience one hour after your question was originally posted. This will not help your cause and is only likely to make our volunteer helpers impatient with you.
If you have a question which has received no response for 24 hours then feel free to post a simple bump to bring it back to the attention of our experts.

Second as an expert.
If you build your subform on a QueryDef which exactly matches the data you want to export, then you should get what you need. If this cannot be achieved for any reason, then as the others have said, you will need to let us see the code you're currently using for us to help you.
Feb 8 '07 #5
okan
7
sorry for my impatience.

code is here

Expand|Select|Wrap|Line Numbers
  1. Dim oApp As Object
  2.  
  3.     Set oApp = CreateObject("Excel.Application")
  4.     DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, "Subform1", "c:/deneme/result.xls", True
  5.     oApp.Application.Workbooks.Open ("c:/example/result.xls")
  6.     oApp.Visible = True
this is the main part of code. I have subform1 and i try to pass all fiedls to excel. but as i said before i want to send only country infos which i choose in the from when i run the code. It should send all countries' infos to excel

thanks for tips
Feb 9 '07 #6
NeoPa
32,094 Expert Mod 16PB
I would guess from your code that you get an error when trying to run this code as (unless "Subform1" is a Table or QueryDef), this is not a valid parameter.
Other than that we're still running on little to no information.
You should really be determining for yourself before posting what information is required. We can help if you get it a little wrong, but we can't go through a process of detailed instruction for everyone who posts questions. The overhead would be too onerous.
Obviously code is required so thanks for that. You've hinted at where this code is run from, though the procedure name line would have been more helpful.
We need details about what you have on your form and subform and how the records of the subform are restricted (filtered) if they are. You may also need to provide Table MetaData to help us to understand how your form fits in.
Posting Table/Dataset MetaData
Expand|Select|Wrap|Line Numbers
  1. Table Name=tblStudent
  2. StudentID; Autonumber; PK
  3. Family; String; FK
  4. Name; String
  5. University; String; FK
  6. MaxMark; Numeric
  7. MinMark; Numeric
Also, if your code gives an error while compiling or running, we need that too.
Remember, we are happy to help you with our experience, but debugging remotely is very difficult if we don't even have the basic information. I appreciate you may not know exactly what we need, but if you make an attempt to think about what is required (you, after all, are the only one who knows all the details, including what may, or may not, be relevant) we can help you on from there.
This may seem like a lot of trouble to go to, to get a problem solved, and if you feel it's not worth the trouble then we fully understand.
Feb 9 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Andy Davis | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.