Results 1 to 6 of 6
  1. #1
    BatmanMR287 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jan 2014
    Posts
    69

    Deleting entire row


    I need to automate the process of deleting the first two rows of a table. I can't find any VBA examples of how to do this.
    The end users will have no access to the tables so this process needs to be written in code.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Must use filter criteria to identify the rows.
    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. #3
    BatmanMR287 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jan 2014
    Posts
    69
    I'm taking the data from a linked XLS sheet. The complete first two rows can be tanked. Won't filter criteria affect the entire column?

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Why should it? The filter criteria should identify only the two records.
    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. #5
    BatmanMR287 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jan 2014
    Posts
    69
    Ok, just so we are straight. Rows go from left to right, columns are up and down. When I transfer the data from the linked XLS sheet it brings the first two rows and there are 98 columns. What is deleted differs from column to column so one criteria won't work. Some data to be deleted is a sentence, others say #Num!. Do I need to type the sentences to be deleted as criteria?

    Another option would be to use auto number and exclude the data from the first two but not having any luck resetting the autonumber in the receiving table.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Consistency is critical. If there is no consistent value to identify these two rows, how can you instruct Access via a DELETE sql action to remove them?

    If you are appending records from the Excel link to an existing table - no, should not reset autonumber. What I think could do, is before the import, identify the last used autonumber value and then delete the first 2 records that follow. This should be programmable.
    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.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Drop Down Box changes entire column
    By tennisbuck in forum Forms
    Replies: 4
    Last Post: 02-26-2014, 12:23 PM
  2. Copy Entire Record
    By pcli in forum SharePoint
    Replies: 8
    Last Post: 04-23-2012, 03:48 PM
  3. Exporting entire Database
    By afg9881 in forum Import/Export Data
    Replies: 4
    Last Post: 05-12-2011, 01:52 PM
  4. QBF (search entire field)
    By 161 in forum Queries
    Replies: 9
    Last Post: 02-09-2011, 03:01 PM
  5. Replies: 11
    Last Post: 12-14-2010, 01:25 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