473,385 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

how to use immediate window, debug.print

Please help, I am desperate on this issue. I am quite the novice at this but I hope someone out there can offer assistance. I am currently using access 2010. I am trying to use syntax recommended for the immediate window as suggested by articles. Here is the string:
Expand|Select|Wrap|Line Numbers
  1. strSql = "SELECT tblPersons.PersonID, tblPersons.lastName, tblPayments.paymentAmt, tblPayments.paymentDate, tblPayments.UnitID " & _
  2. "FROM tblPersons LEFT JOIN tblPayments ON tblPersons.PersonID = tblPayments.personID " & _
  3. "WHERE tblPersons.PersonID " = Me!txtpersonID & _
  4. " ORDER BY tblPersons.PersonID, tblPayments.paymentDate DESC;"
I am typing ?strSql in the immediate window but NOTHING is happening. I have typed command (in code) debug.print strSql and ?strSql in immediate window but nothing happens. I seem to get a response from some function such as now(), but cannot see the sequel string as suggested by all of the reading. Do I need to set some parameters in some properties window? I have the form open in design view. This is in a form module on the page with a lot of other code, if this makes a difference (none of the other code uses strSql as a string value.) I apologize for the very rudimentary nature of this question, but I do not get it!
Jul 25 '14 #1

✓ answered by Seth Schrock

The code has to be running when you enter the ?strSql in the immediate window. If you click in the gray area to the left of your code window (between the list of modules, forms, and class modules and your code), a red dot will appear. This is a break point for your code. Place one on the line just below the code that you provided above. Then run your code. If this is in a button's OnClick event, then click the button, etc. The code execution will stop on the line you selected. Now you can enter your stuff in the immediate window.

5 3928
Seth Schrock
2,965 Expert 2GB
The code has to be running when you enter the ?strSql in the immediate window. If you click in the gray area to the left of your code window (between the list of modules, forms, and class modules and your code), a red dot will appear. This is a break point for your code. Place one on the line just below the code that you provided above. Then run your code. If this is in a button's OnClick event, then click the button, etc. The code execution will stop on the line you selected. Now you can enter your stuff in the immediate window.
Jul 25 '14 #2
BikeToWork
124 100+
Shouldn't "WHERE tblPersons.PersonID " = Me!txtpersonID & _
be "Where tblPersons.PersonID = " & Me!txtpersonID & _
?
Jul 25 '14 #3
Seth Schrock
2,965 Expert 2GB
Good catch BTW. You are correct the equals sign should be inside the double quote.
Jul 25 '14 #4
To Seth and others:
Thank you so much for the advice! I have an extensive resource "the 2007 access bible" or something of this nature. In the debugging section, it says something about the immediate window and the ? command but does not refer to anything else about the process. From the context of this manual, there is no way that one could surmise what you suggested to do. By the way, I did have the correct syntax on the 'where' statement; I must have accidentally misplaced the " inside of the = sign right before copying. The code runs great though. I was not initially getting the extra space requirement when I tried to ready sequel string for VBA consumption. I have programmed a little in c++ (only structured programming) and this object-oriented process takes some getting used to! Thank all of you for your assistance. Sorry for the long-winded reply.
Jul 26 '14 #5
NeoPa
32,556 Expert Mod 16PB
Your posts are fine.

BTW. You may find some more help on debugging in Debugging in VBA.
Jul 26 '14 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Tony | last post by:
Hello, Using Access2000, WinNT. Using the Immediate Window, I can view the results of my VBA code as it performs operations/calculations on my data. Now that I have all the bugs worked out,...
7
by: MLH | last post by:
?2944*24 gives me an overflow error, entered in the immediate window. Anybody else?
9
by: David A. Beck | last post by:
When I do a debug.print("blabla") in VB (VS2005) it doesn't show up in the output window, what gives?
6
by: Deano | last post by:
I'm just looping through some tables and printing the names to the immediate window. I notice that I lose the first few after the code has run. If I step through they do get printed intially. ...
7
by: MLH | last post by:
I use this to list table fieldnames to the debug window. Can it be modified to perform similar objective for saved query objects? Would it be best to trash this completely and write a procedure...
3
by: Dixie | last post by:
Is there any code I can use to send the contents of the immediate window to a text file? dixie
1
kirubagari
by: kirubagari | last post by:
rivate Sub cmdscan_Click() Const a As Byte = 4 Const b As Byte = &HFF Dim I As Long Dim AnyChanged As Boolean Dim changeMade As Boolean Dim value As Byte Dim x Dim tmp As String
3
by: DoctorIce | last post by:
Guys, Im experiencing a strange problem. I'm using the Immediate window in Access 2000 to track output from a program as it loops through a recordset. So, I'm using Debug.Print statements to sent...
4
by: =?Utf-8?B?R3V5IENvaGVu?= | last post by:
Hi all I tried the (good old...)vb6 command debug.print and it does not work in vb.net 2005 I googled some and found these samples: Debug.WriteLine("hello") Console.WriteLine("hello")...
6
by: jimatqsi | last post by:
To celebrate my 800th Bytes post I'm posting my first article. I plan to post a number of articles in a "Dev Tools" series; those being articles containing tools for developers to use as opposed to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.