473,398 Members | 2,088 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,398 software developers and data experts.

Stepping through one subroutine only in VBA

Hello.....

RE: Access 2003 / VBA Editor

Given the sample code:

Public Sub TestPayment()
Line 1: lngCalculated Amount = ('my large decimal calculation)
Line 2: strFileOut = gblCurrPath & gblNewFileOut
Line 3: MsgBox "Checking Amount" & vbCrLf & vbCrLf & _
"New Calculated Amount: " & Cstr(lngCalculated Amount)
& _
"located at " & strFileOut & _
, vbOKOnly + vbInformation, "Calculation Result"
Lines 4 & following: (populate a new recordset and proceed on...)
End Sub

I want to check these values and then make sure my msgbox is formatted
correctly and looks good for the user. In the VBA Editor, is there a
way I can simply step through all lines of this sub only...and
stop...then tweak my msgbox formatting and re-test this paragraph
again?

I'm not interested in stepping through any other portions of my app in
debug mode; just this paragraph only.

Thanks.
Dec 13 '07 #1
2 1528
<rl*********@yahoo.comwrote in message
news:6c**********************************@e6g2000p rf.googlegroups.com...
Hello.....

RE: Access 2003 / VBA Editor

Given the sample code:

Public Sub TestPayment()
Line 1: lngCalculated Amount = ('my large decimal calculation)
Line 2: strFileOut = gblCurrPath & gblNewFileOut
Line 3: MsgBox "Checking Amount" & vbCrLf & vbCrLf & _
"New Calculated Amount: " & Cstr(lngCalculated Amount)
& _
"located at " & strFileOut & _
, vbOKOnly + vbInformation, "Calculation Result"
Lines 4 & following: (populate a new recordset and proceed on...)
End Sub

I want to check these values and then make sure my msgbox is formatted
correctly and looks good for the user. In the VBA Editor, is there a
way I can simply step through all lines of this sub only...and
stop...then tweak my msgbox formatting and re-test this paragraph
again?

I'm not interested in stepping through any other portions of my app in
debug mode; just this paragraph only.

Thanks.
Sure you can. Just call it from the immediate window:

Place a breakpoint on the 1st line of the sub. Then just type TestPayment
and press enter. When the sub terminates, to test it again, in the immediate
window, put the cursor on the line you typed previously and press enter
again. And so on ad nauseam till you get it right :)
Dec 13 '07 #2
Your solution worked great...thank you! I appreciate it.
Dec 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Farber | last post by:
Not sure if this is the right group for this but anyways... I've got an ASP web application that uses a Visual Basic component to do some work. I instantiate the component in asp and then...
3
by: Scott | last post by:
What is the proper syntax for sending an argument from a form contol to a subroutine in a module? For instance, from a textbox on a form I call a module subroutine from the textbox's OnUpdate...
7
by: Richard Grant | last post by:
Hi. In c/C++ i can pass the address of a subroutine to another subroutine as an actual parameter How do I do that in VB .NET What should be the syntax for a parameter to receive the address of a...
2
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! ...
10
by: nasau | last post by:
Perl, I have a main program which calls two subroutines (depending upon the report names).In the subroutine I am printing the data from CSV file using the format variable, Format_top prints the...
1
by: peterv6 | last post by:
I'm using a "package" type subroutine, called test_package.pl. I'm calling it from a script called split0.pl. I want to pass the $0 variable, use the subroutine to split out just the filename, and...
7
by: Lyn | last post by:
Is there a solution to this problem? While stepping through code (F8) it would sometimes be helpful to observe changes occurring on the affected form in the Access window. However, the current...
3
by: sangith | last post by:
Hi, I have question on processing the file handle in a subroutine. Here is my program without subroutine: open FH1, "<outfile" or die "cannot open the file for reading: $!\n"; while...
3
shrek123
by: shrek123 | last post by:
How can I pass output of some perl subroutine to a subroutine? I have Subroutine1 and wanna pass the return value of this subroutine as an argument to another subroutine. I tried this; ...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.