Results 1 to 5 of 5
  1. #1
    SCFM is offline Novice
    Windows XP Access 2010 (version 14.0)
    Join Date
    Feb 2010
    Posts
    13

    Crushing Rows

    I have a table like this:
    Field1 Field2


    Alfa 1
    Beta 2
    (Blank) (Blank)
    Delta 4
    . .
    . .
    etc.

    I need a Visual Basic way to convert the table like:
    Field1 Field2
    Alfa 1
    Beta 2
    Delta 4
    . .
    . .
    etc.

    In other words, using VB, I need to delete the blank rows. Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    If you actually want to delete them, run a delete query with

    Is Null

    as the criteria on those two fields.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    SCFM is offline Novice
    Windows XP Access 2010 (version 14.0)
    Join Date
    Feb 2010
    Posts
    13
    Thank you, but I'm really interested in a VB script.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Ah, you want to use the more difficult and complicated method. You can open a recordset on the table, loop through it, and delete any record where those two fields are empty (or whatever the appropriate criteria are). It will take a lot longer and not be as reliable, but it will use VBA. Look at recordsets (DAO or ADO), loops, and the Delete method.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    sheesh - Baldy - what's the point in trying to help these guys !!... wants a "vb script" ...gimme a break.....post at a vb forum then - - this is a db forum and expect sql solutions......if it works it works; and besides an sql statement can be in vb so what's the dif.....

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

Similar Threads

  1. Combining columns into rows
    By steeveepee33 in forum Queries
    Replies: 5
    Last Post: 04-30-2009, 09:18 PM
  2. How to get rows with empty fields as well?
    By Orabidoo in forum Queries
    Replies: 10
    Last Post: 04-24-2009, 06:08 PM
  3. Counting rows
    By anishap in forum Access
    Replies: 0
    Last Post: 10-08-2008, 10:41 PM
  4. Replies: 1
    Last Post: 05-29-2008, 04:27 PM
  5. Queries the max from two rows
    By mohsin74 in forum Queries
    Replies: 0
    Last Post: 12-15-2006, 12:52 AM

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