Debug.Print sSql

  • Thread starter enrico via AccessMonster.com
  • Start date
E

enrico via AccessMonster.com

how do you use Debug.Print sSql on checking the error of your code?
 
S

Stefan Hoffmann

hi Enrico,
how do you use Debug.Print sSql on checking the error of your code?
e.g.

Dim SQL As String

SQL = "build your statement..."
Debug.Print SQL
CurrentDb.Execute SQL, dbFailOnError


And in the case of an error, I simply copy the SQL statement from the
immediate window, create a new query, switch to the SQL view, paste it
and troubleshoot it.


mfG
--> stefan <--
 
J

June7 via AccessMonster.com

Put a breakcode on the line following the Print.Debug. This will stop code
running and allow you to see in the Immediate window the string you built.
 
J

June7 via AccessMonster.com

Make sure you have the Immediate window on. Menu/View/ImmediateWindow
 
Top