Page 3 of 3 FirstFirst 123
Results 31 to 35 of 35
  1. #31
    Geoff_G is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    2

    To reduce the length of the SQL statement, use the In() clause (as suggested in first reply by pbaldy above).

    For example:
    WHERE BookingsID In (25717, 25398, 25832, 25834, 25782, 24950)

  2. #32
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by ItsMe View Post
    Close While using Wend

    Close Do using Loop

    Do While
    Something
    Loop

    Do Until
    Something
    Loop

    While
    Something
    Wend

    These are the rules I use:
    If you want to write code that you can exit a loop then use Do and Loop. If you do not write code in the loop to "Exit Do" then leave Do out entirely. Another reason to use Do is when you need to evaluate "Until".
    is there any reason why you would choose while over do?

  3. #33
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    My impression is that your VBA is compiled better and it is more efficient in RunTime.

    I could be wrong. It is just a rule I follow. Do with Loop has the option to exit the loop with an Exit Do line of code. If Runtime has to anticipate this happening, slower performance.

    If you have a lot of records and a stopwatch you can test it for us.

  4. #34
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    No particular reasons other than it's simple and I am comfortable with it and it works. And as ItsMe points out, don't need any exit strategy.
    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. #35
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Thanks for the info guys

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Filter By Form and Apply Filter Buttons
    By JustLearning in forum Forms
    Replies: 13
    Last Post: 02-18-2015, 01:01 PM
  2. Replies: 5
    Last Post: 02-07-2013, 12:21 PM
  3. Replies: 1
    Last Post: 08-16-2012, 01:51 PM
  4. Replies: 28
    Last Post: 03-08-2012, 06:47 PM
  5. Show array of bytes as picture in form
    By HZwaan in forum Forms
    Replies: 0
    Last Post: 06-17-2010, 04:07 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