What is debug.print

G

Guest

Hi
Sit here and try to understand and learn VBA access

I have this

Private Sub klormen_Click()
Dim db As Database
Dim rs As Recordset

Set db = CurrentDb()
Dim strsql As String
strsql = "SELECT * FROM Kunder WHERE KøbIalt >= 100000"
Set rs = db.OpenRecordset(strsql, dbOpenSnapshot)
Do Until rs.EOF
Debug.Print rs("Firma")
rs.MoveNext
Loop

But how can i see what is in debug.Print ??

Alvin
 
R

Roger Carlson

Debug.Print will print the value following it into the Immediate Window of
your VB Editor. Best way to see this is to put a Break Point on the
rs.MoveNext line in your code. (You do this by clicking on the far left
margin. You'll see a red dot appear there.) Then run the form and click
the button. The code will stop at the code break and you can look in the
Immediate Window to see the value. Push F5 to continue running the code.
It will run until you hit the next code break, which will be the next
iteration of the loop.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top