M
Mark
First let me give the create to Luke Chung for this code.
I was checking out this website (http://www.fmsinc.com/tpapers/queries/)
when I saw this code and I wanted to use it. The question I have is on the…
…Debug.Print part. He said it would display in the immediate window. Is
there a way to have this print on a form, or a component within a form, i.e.
listbox, text fields, etc.? If so, how? If not, what? Thanks
Private Sub RecordSetQuery ()
Const strQueryName = "Other: Top 10 Auto Companies"
Dim db As Database
Dim rs As Recordset
Set db = CurrentDB() ' Open pointer to current database
Set rs = db.OpenRecordset(strQueryName) ' Open recordset on saved query
Do While Not rs.eof
Debug.Print ("Company: " & rs![Company] & " Sales: " & rs![1994])
rs.MoveNext
Loop
rs.Close
db.Close
End Sub
I was checking out this website (http://www.fmsinc.com/tpapers/queries/)
when I saw this code and I wanted to use it. The question I have is on the…
…Debug.Print part. He said it would display in the immediate window. Is
there a way to have this print on a form, or a component within a form, i.e.
listbox, text fields, etc.? If so, how? If not, what? Thanks
Private Sub RecordSetQuery ()
Const strQueryName = "Other: Top 10 Auto Companies"
Dim db As Database
Dim rs As Recordset
Set db = CurrentDB() ' Open pointer to current database
Set rs = db.OpenRecordset(strQueryName) ' Open recordset on saved query
Do While Not rs.eof
Debug.Print ("Company: " & rs![Company] & " Sales: " & rs![1994])
rs.MoveNext
Loop
rs.Close
db.Close
End Sub