how do you use Debug.Print sSql on checking the error of your code?
E enrico via AccessMonster.com May 15, 2009 #1 how do you use Debug.Print sSql on checking the error of your code?
S Stefan Hoffmann May 15, 2009 #2 hi Enrico, how do you use Debug.Print sSql on checking the error of your code? Click to expand... 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 <--
hi Enrico, how do you use Debug.Print sSql on checking the error of your code? Click to expand... 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 <--
E enrico via AccessMonster.com May 15, 2009 #3 i already tried it but it still doesn't show on my screen
J June7 via AccessMonster.com May 15, 2009 #4 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.
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 May 15, 2009 #5 Make sure you have the Immediate window on. Menu/View/ImmediateWindow