Change Query Views Using Command Bars Code

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024

Комментарии • 3

  • @johnclark851
    @johnclark851 Год назад +1

    Hi Colin, I noticed that in your loop, there is no "i = i + 1" Have I been adding unnecessary code all this years?

    • @IsladogsOnAccess
      @IsladogsOnAccess  Год назад +2

      Hi John
      That depends as there are many ways of doing a loop. For example:
      a) In the example supplied, I use a For...Next loop and the Next line will increment the counter. Perhaps more obvious if instead I had written it as Next i
      b) Using Do Until i = 2 ....Loop, I would start with i=0 before the loop and would need to include i=i+1 in the loop as that doesn't increment automatically
      Similarly with While...Wend
      c) When looping through a recordset, you would use i=i+1 before the .Next line

    • @johnclark851
      @johnclark851 Год назад +1

      Thanks Colin, always good to learn something new.