Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24
  1. #16
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922

    That is the problem with AIR CODE. I can't really compile and test it. I've changed it since the original post. Are you replacing *all* of the previous code with my latest post? Try it again. Leave the stuff in the standard module alone.

  2. #17
    stephenaa5 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    72
    I hear you on the "air code." I try diagnosing people's problems restoring classic Thunderbirds without ever seeing the car. But that's easier, I'm sure.

    Definitely getting there... It fires right, but now the error is:
    "The Microsoft Office Access database engine could not find the object "c:\documents and settings\Stephen\Desktop\Excel Files (*.xls)".

  3. #18
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I cribbed something together on my system and it looks like it should work. How about pasting what you have here. Use the code tags (press the # button).

  4. #19
    stephenaa5 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    72
    I'm inserting it exactly as below. I don't understand the "code tags" piece you requested. Sorry, learning....

    Private Sub ImportButton_Click()
    Dim strFilter As String
    strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
    SelectFile = ahtCommonFileOpenSave( _
    Filter:=strFilter, OpenFile:=True, _
    DialogTitle:="Please select an input file...", _
    Flags:=ahtOFN_HIDEREADONLY)
    DoCmd.TransferSpreadsheet _
    acImport, _
    acSpreadsheetTypeExcel5, _
    "SvcCallImportTbl", _
    strFilter, _
    True
    End Sub

  5. #20
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    That's what I thought. Copy what I have here and paste it over what you have.
    Code:
    Private Sub ImportButton_Click()
       Dim strFilter As String
       Dim SelectFile As String
       strFilter = ahtAddFilterItem(strFilter, "Excel Files (*.XLS)", "*.XLS")
       SelectFile = ahtCommonFileOpenSave( _
                    Filter:=strFilter, OpenFile:=True, _
                    DialogTitle:="Please select an input file...", _
                    Flags:=ahtOFN_HIDEREADONLY)
       DoCmd.TransferSpreadsheet _
             acImport, _
             acSpreadsheetTypeExcel5, _
             "SvcCallImportTbl", _
             SelectFile, _
             True
    End Sub
    If you use the advanced mode or press the Post Reply button, one of the tool buttons is the Octothorpe "#". If you press it, it will put two code tags in your window. Anything inside of the tags has the indentation preserved as my code does. Without the tags, the system removes most of the white space and you loose your formatting.

  6. #21
    stephenaa5 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    72

    import/export

    YIPPEEEEE!!!!!!!!

    Good to know. So QuickReply 86's a bunch of formatting information. Were I more experienced, I would have noticed. Sorry about that.

    It took me a minute to reply because I've been jumping up and down on my desk once it worked!

    Final question, and ABSOLUTELY feel free to say "I'm busy with my day job now, pound sand," if it's a difficult thing to do. The reverse is also very useful. Taking the table and exporting to a spreadsheet. Say, SITEDATA table exported to (excel file chosen). Easy, or hard?

    Thanks a million. This really cleaned things up in this application. I sincerely appreciate your help.

    Stephen.

  7. #22
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Just as easy.

  8. #23
    stephenaa5 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    72
    Why don't they make a function like that for IMPORTING?!?!?!
    DoCmd.OutputTo acOutputTable, "Tbl_YourTable", acFormatXLS

  9. #24
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows XP Access 2002
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Because you need to create the Import Specification first and save it.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Password Prompt
    By thestappa in forum Security
    Replies: 1
    Last Post: 01-28-2010, 09:19 PM
  2. Filename displaying with image
    By Rob Parker in forum Forms
    Replies: 2
    Last Post: 01-13-2010, 05:05 PM
  3. prompt criteria issues
    By Rik_StHelens in forum Queries
    Replies: 1
    Last Post: 10-16-2009, 10:17 AM
  4. Removing the delete prompt.
    By botts121 in forum Programming
    Replies: 4
    Last Post: 06-26-2009, 11:45 AM
  5. Replies: 0
    Last Post: 06-11-2009, 01:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums