Results 1 to 7 of 7
  1. #1
    XX7 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    4

    simply macro IF then

    Hi,

    I naeed help about "simply" macro if in access.


    For ex.

    Table - X
    Column - 1 and 2

    I need setup macro that if in Column 2 = 0 then delete row.

    This is my try
    Click image for larger version. 

Name:	Capture.JPG 
Views:	11 
Size:	15.8 KB 
ID:	17216

  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,652
    For the whole table? I would run a delete query with that criteria:

    DELETE * FROM X
    WHERE 2 = 0
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    XX7 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    4
    Yes from the whole table.
    Yeap query is second(first) option, but I try to get same result over the macro, so if some guru can help me.
    Thx in advance.

  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,652
    Run the query from the macro. I don't know that you can loop the table's records from a macro, and even if you could it would be far less efficient than executing an update query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    XX7 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    4
    I don't know, I am asking is it possible to do over macro?
    If yes pls help.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I can't think of a way.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    XX7 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    4
    Good maybe some other can, because of that I setup this thread.
    EOF or any other solution?
    Thx in advance.

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

Similar Threads

  1. Replies: 10
    Last Post: 01-21-2014, 11:09 AM
  2. simply adding a field
    By Woodworker in forum Access
    Replies: 5
    Last Post: 11-09-2012, 09:23 AM
  3. The simply way to consolidate two bases...
    By jeanpri in forum Import/Export Data
    Replies: 4
    Last Post: 05-14-2012, 01:53 AM
  4. Simply Multiplication on SubForm field using VBA
    By DB2010MN26 in forum Programming
    Replies: 1
    Last Post: 12-10-2011, 01:00 AM
  5. Replies: 0
    Last Post: 01-12-2011, 12:43 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