VBA/SQL - Help!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emmachristison
    New Member
    • Feb 2020
    • 1

    VBA/SQL - Help!

    Hey, my query is not working anymore - I think I have put something in the wrong place but would appreciate any help anyone could give. I've just restarted my coding journey so am a bit lost!

    Thanks in advance :)
    Attached Files
  • SioSio
    Contributor
    • Dec 2019
    • 272

    #2
    I took a quick look , I found two mistakes.
    First, this source executes
    Code:
    cn.Execute(StrQuery)
    before setting SQL command to "StrQuery".
    Second, the
    Code:
    rs.MoveNext
    i = i + 1
    statement is not executed in Do loop.This is infinite loop.

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      That picture is too small and blurry. Copy and paste the code instead.

      You also need to supply more information than "not working". That tells us nothing about what's not working. Are you getting an error message? Are you getting incorrect results?

      Comment

      Working...