Page 2 of 2 FirstFirst 12
Results 16 to 23 of 23
  1. #16
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117

    Cool

    hi june7



    before this file extention was .accdb now i save it in .mdb
    i am using 2007access. i want to use this code in 2007.
    i have more questions.

    1. how can i use in code "refresh all".
    2. how can i overwrite data by importing if its existing before in same date.

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    1. Google: refresh requery
    http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

    2. Delete all the records first then append all new set to table
    DoCmd.RunSQL "DELETE FROM tablename"
    or delete with WHERE clause to remove selected records.

    You still haven't responded to my questions about error message and debugging. I am reluctant to assist if you have not made effort to solve.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #18
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117
    HI june7

    i tried to debug also but i could not find any thing.

    i have attached before table form and module now you can also check.

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    What do you mean, did not find anything? Was there an error message? Did the procedure run to end without error message but no import took place? Did the code divert to the error handler? What was the error code? Step debugging will provide answers. That means running the code one line at a time. Or comment out the On Error GoTo line so the debug will stop and highlight the bugging line.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #20
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117

    Cool

    hi june7

    on this line of code error appear

    If rstRead.BOF And rstRead.EOF Then
    strMsg = "The import spec was not found. Cannot continue."
    'MsgBox strMsg, vbExclamation, "Error"

    i tell you i am new in access programing before i am using excel macro
    now i have move to access may be my some question are like child question.

    dont mind only cooperate with me i always busy on my job i get little time to study but i want to improve myself. i do self study only online my working hrs 12 hrs 2 hrs spend coming and going 2 hrs cutting,cooking and eating prepare myself like uniform washing etc..
    2 hrs for study rest for sleep.

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    We are all busy and most of us responding here are volunteers, not staff of the forum. Most of us are like you, using Access as part of trying to do a job but are not professional programmers.

    WHAT IS THE ERROR MESSAGE?

    BOF means Beginning of File and EOF means End of File. The recordset is either at the BOF or EOF or somewhere in between. Change the And to Or. Run the code again. Does it still error or do what you want? This is debugging and a process you need to learn and use to be an effective programmer. If you want to use code, need to understand it. If you don't have basic knowledge of programming concepts then you will be frustrated in efforts.

    I finally got a minute to download your project. I was surprised to find code I would not have expected from a beginner (such as getting the file path for the project). Makes me wonder why you were not already familiar with debugging techniques.

    I tried running your code and it locks up Access and have to kill it with Task Manager. You have a lot of debugging effort to do. Actually, think the BOF Or EOF test will never work. Use If rstRead.RecordCount = 0 instead.

    Your project does not include all tables needed by the code. The code is opening a recordset on table ImportColumnSpecs which is not in the project. How can anyone test your code?
    Last edited by June7; 09-06-2011 at 12:51 PM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #22
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117

    Cool

    thanks june7

    i learned every thing online by selfstudy i did not use before debugging techniques.
    how can i use it?

  8. #23
    waqas is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    117

    Thumbs up

    june7

    hurray i got it.
    it is working now.

    thanks for assisstance.

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

Similar Threads

  1. excel link with access differs from simple export from access
    By M0RDANT in forum Import/Export Data
    Replies: 4
    Last Post: 03-25-2013, 02:43 PM
  2. Export from Access to Excel
    By Eowyne in forum Import/Export Data
    Replies: 5
    Last Post: 04-23-2011, 07:08 PM
  3. Export Access '07 Pivot Tbl to Excel'07
    By nagiese in forum Import/Export Data
    Replies: 1
    Last Post: 02-08-2011, 08:19 AM
  4. Access date export to excel
    By jituknows in forum Access
    Replies: 1
    Last Post: 02-05-2011, 01:32 PM
  5. Access export to Excel
    By Rick West in forum Import/Export Data
    Replies: 4
    Last Post: 01-09-2010, 03:40 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