lost records appearing in table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maverick6197 via AccessMonster.com

    lost records appearing in table

    I have a command button on my form which opens the standard windows dialog
    box and allows you to choose a file. After picking a file, the
    transferspreads heet method is ran. This pulls data into a table. I then run
    an append query to append this data to the end of another table. I then run
    one last query, a delete query to clear the data from the first table. Here
    is my code......

    _______________ _______________ _______________ ____
    Private Sub cmdImportWarran tyReg_Click()
    Me!txtImportFil e = LaunchCD(Me)

    Dim FileName1 As String
    FileName1 = Me.txtImportFil e

    If FileName1 = "" Then
    GoTo Exit_cmdImportW arrantyReg_Clic k
    End If


    DoCmd.TransferS preadsheet acImport, , "Import: tblWarrantyReg" ,
    FileName1, -1, "tblWarrantyReg !A1:AE2"
    DoEvents

    Dim stDocName3 As String

    stDocName3 = "Append: tblWarrantyReg"
    DoCmd.OpenQuery stDocName3, acNormal, acEdit
    DoEvents

    Dim stDocNameW As String
    stDocNameW = "DELETE: Import: tblWarrantyReg"
    DoCmd.OpenQuery stDocNameW, acNormal, acEdit
    DoEvents


    DoCmd.Save

    DoCmd.Close
    DoCmd.OpenForm "frmWarrantyReg "
    DoCmd.GoToRecor d , , acLast


    Exit_cmdImportW arrantyReg_Clic k:
    Exit Sub
    End Sub
    _______________ _______________ ____________

    Is there any reason why blank records would start appearing in my table.
    Many times I can open my table and find blank records. The only field that
    will be populated is the primary key field and sometimes a date field.

    Please help. Thanks in advance.

    Shannan

    --
    Message posted via AccessMonster.c om


  • Rick A.B.

    #2
    Re: lost records appearing in table

    On Jun 9, 7:33 am, "Maverick61 97 via AccessMonster.c om" <u42957@uwe>
    wrote:
    Is there any reason why blank records would start appearing in my
    table.
    Many times I can open my table and find blank records.  The only field that
    will be populated is the primary key field and sometimes a date field.
    >
    Please help.  Thanks in advance.
    >
    Shannan
    >
    --
    Message posted via AccessMonster.c omhttp://www.accessmonst er.com/Uwe/Forums.aspx/databases-ms-access/2008...
    Shannan,
    I don't see anything in your code, I would suspect that it's something
    in the file you're importing or in your append query. I would set a
    break on your import statement then check your import table before you
    delete it to see if anythings wrong. You should also consider using a
    Temp database when importing your data so you aren't bloating your
    database. Tony Towe has an excellent example of this at

    Let us know if you find anything.

    Hope that helps

    Rick

    Comment

    • Rick A.B.

      #3
      Re: lost records appearing in table

      Shannan,
      I don't see anything in your code, I would suspect that it's something
      in the file you're importing or in your append query.  I would set a
      break on your import statement then check your import table before you
      delete it to see if anythings wrong.  You should also consider using a
      Temp database when importing your data so you aren't bloating your
      database.  Tony Towe has an excellent example of this athttp://www.granite.ab. ca/access/temptables.htm
      Let us know if you find anything.
      >
      Hope that helps
      >
      Rick
      Sorry for blowing your name Tony, It's Tony Toews. My fingers are
      constantly getting ahead of what little brain matter I have left.
      (Old farts disease your know)

      Rick

      Comment

      • Maverick6197 via AccessMonster.com

        #4
        Re: lost records appearing in table

        Rick,

        I will try this, thanks for your help....



        Rick A.B. wrote:
        >Shannan,
        >I don't see anything in your code, I would suspect that it's something
        >[quoted text clipped - 8 lines]
        >>
        >Rick
        >
        >Sorry for blowing your name Tony, It's Tony Toews. My fingers are
        >constantly getting ahead of what little brain matter I have left.
        >(Old farts disease your know)
        >
        >Rick
        --
        Message posted via http://www.accessmonster.com

        Comment

        Working...