Ask Experts Questions for FREE Help !
Ask
    kenzie416's Avatar
    kenzie416 Posts: 4, Reputation: 1
    New Member
     
    #1

    Jul 12, 2007, 11:17 AM
    Exporting from Access to Excel
    Scottgem,

    Here is the sample database & associated excel file relating to my problem w/ exporting from access to excel (thread started in AllExperts.com); you'll need to go into the VBA of the Access database and change the reference to the location of the excel file in order for it to run (I've marked the locations in the code). You should be able to start by clicking on all of the checkboxes in "form1" of the database "dbsample.mdl", and clicking "execute" and it will automatically run the query and transfer the associated fields to excel. Then you'll need to close the spreadsheet before running the query again. Then run the query again by clicking on 2 or 3 of the checkboxes and it should run fine. Then if you run the query again, clicking on all 4 checkboxes, an "error 3190: Too many fields defined" should come back. That's what I'm stuck at.

    Thanks in advance to any help you can provide,
    Heidi
    Attached Files
  1. File Type: zip sampleDB.zip (58.2 KB, 44 views)
  2. ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #2

    Jul 12, 2007, 12:02 PM
    Found it. The problem was your named range (quer) in the worksheet was set to two columns. It would work as long as only 2 boxes where checked. But once you checked another box. It bombed. I increased the range to the E column and it worked fine.
    kenzie416's Avatar
    kenzie416 Posts: 4, Reputation: 1
    New Member
     
    #3

    Jul 12, 2007, 12:23 PM
    I tried increasing the named range (quer) to 8 columns, and it worked for the next time I ran the query with all 4 boxes checked, but it redefined quer to accommodate the 5 columns I needed. When I ran the query again for 2 checkboxes, is again redefined quer for the 3 columns that I needed. Then I ran it again w/ all 4 boxes checked and it bomb. It seems like I can decrease the number of columns needed and it will defined the named range fine, but increasing the number of columns is a problem.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #4

    Jul 12, 2007, 12:47 PM
    Ahh I didn't test enough. Something is causing the quer range to fit the exported data. Once its less than 4, it won't allow more than what its set for.

    One solution might be to redefine the quer range when the worksheet is closed. Or after the import is finished.
    kenzie416's Avatar
    kenzie416 Posts: 4, Reputation: 1
    New Member
     
    #5

    Jul 12, 2007, 01:43 PM
    I was thinking somewhere along those lines... in fact, I was trying something along those lines earlier today w/ no success. Do you know how to do this in Excel VBA? If not, I can check w/ an Excel expert.
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #6

    Jul 12, 2007, 03:19 PM
    Try the people at utteraccess.com (another site I hang at). There are a few Excel MVPs there who may be able to help further. My Excel VBA is limited.
    kenzie416's Avatar
    kenzie416 Posts: 4, Reputation: 1
    New Member
     
    #7

    Jul 13, 2007, 10:09 AM
    I pinged an Excel guy and got it worked out. Thanks much!
    ScottGem's Avatar
    ScottGem Posts: 64,966, Reputation: 6056
    Computer Expert and Renaissance Man
     
    #8

    Jul 13, 2007, 10:47 AM
    What was the solution?

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Exporting Contacts from Microsoft Outlook [ 1 Answers ]

Does anyone know how I can extract a the Contacts from one Outlook to another? Export and Import or? Any ideas and suggestions please? Thanks!

Exporting ayurvedic materials [ 1 Answers ]

Hello, I am a exporters of various ayurvedic medicines. Where & how I can find the list of companies which will import the ayurvedic materials?

Access and Excel [ 1 Answers ]

Is it possible to import simple information from a spreadsheet in Excel into a pre-existing Access table? If so, how?


View more questions Search