473,797 Members | 3,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Send Immediate Window contents to form textbox.

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, I want that same debug.print information sent to
a form so a user can see what is happening as the data is being
processed. How can I do that?

It's not so much that I want the Immediate Window to pop-up over my
form but rather getting the same data generated using the debug.print
statement into a scrollable text box on a form. This way a user can
see procedure calls, failure/success results, etc.. as they are
executed in the module.

Any ideas are greatly appreciated!
Tony
Nov 13 '05 #1
4 10780
Yes, for the items you currently have a Debug.Print statement, just set the
value of a textbox instead.

Example from the Immediate window:
Forms!Form22!Te xt0="Hi there"
Forms!Form22!Te xt0=Forms!Form2 2!Text0 & vbCrLf & "Hi there again"

You could use "Me." instead of "Forms!Form 22" if appropriate. You may also
want to play with the SelStart and SelSelect properties of the textbox. Set
the textbox's Scrollbar property to Vertical and the Locked property to Yes.
If you leave Enabled set to Yes, the user will be able to select the text
and copy it for pasting elsewhere. If you set the Enabled Property to No,
the user won't be able to do anything but read the text. Setting Enabled to
No will also disable the scroll bar.

--
Wayne Morgan
MS Access MVP
"Tony" <hs*********@ya hoo.com> wrote in message
news:7e******** *************** ***@posting.goo gle.com...
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, I want that same debug.print information sent to
a form so a user can see what is happening as the data is being
processed. How can I do that?

It's not so much that I want the Immediate Window to pop-up over my
form but rather getting the same data generated using the debug.print
statement into a scrollable text box on a form. This way a user can
see procedure calls, failure/success results, etc.. as they are
executed in the module.

Any ideas are greatly appreciated!
Tony

Nov 13 '05 #2
You can use the SysCmd function for that.

Sub something()
Dim RetVal As Variant

For j = 0 to 50000
'do somthing
RetVal = SysCmd(acSysCmd SetStatus, j)
Next
End Sub

After the first Paren -- SysCmd( you get a dropdown with something like
15 selections. acSysCmdSetStat us is the 12th selection. it will write
data, numeric, text, date to the statusbar of an Access Application.
This way, you can monitor your procedures.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3
Tony wrote:
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, I want that same debug.print information sent to
a form so a user can see what is happening as the data is being
processed. How can I do that?

It's not so much that I want the Immediate Window to pop-up over my
form but rather getting the same data generated using the debug.print
statement into a scrollable text box on a form. This way a user can
see procedure calls, failure/success results, etc.. as they are
executed in the module.


To do this, I usually wrap the debug.print statement into a routine, and
call the routine from every point in my code I'd like to see or monitor
something.
Now, the routine can use a switch (probably a value in a table) to
decide where the output should go.

You could even store all items that get 'printed' by calling this
routine into a table, and do something with them later on.

If you want to be able to fill a control on a form with the text, you
would have to pass that control to the routine, maybe as Optional so the
routine can use IsMissing(), and write the text to the debug window if
that is the case.
Nov 13 '05 #4
"Wayne Morgan" <co************ *************** @hotmail.com> wrote in message
Yes, for the items you currently have a Debug.Print statement, just set the
value of a textbox instead.

Example from the Immediate window:
Forms!Form22!Te xt0="Hi there"
Forms!Form22!Te xt0=Forms!Form2 2!Text0 & vbCrLf & "Hi there again"


Thanks for the reply Wayne,
I updated my code as suggested. Works great until I added it to a
certain procedure. This particular procedure updates records in an
ODBC connected LotusNotes dbs and therefore takes a while to process
completely through. As a result, the messages stopped appearing in
the form until the procedure was finished. This kind of defeated the
purpose of displaying the messages as they were processed. So, as a
solution, I put a DoEvents after updating the form control and before
a call to refresh the form. Adding the DoEvent solved the problem but
as I read more about DoEvent in this group, I wonder if that was the
best solution?

Anyway, thanks for all your help.
Tony
Nov 13 '05 #5

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

Similar topics

0
1286
by: Jim Mitchell | last post by:
I like to display my web site in a window so that users can use the "Send Page" function in IE to mail their output using their client side Outlook program. The problem is that I always get an anoying textbox with some long code showing up in the page. I have tried the following.... 1) Post the innerHTML of a table or form using xml_http to a database and
6
2232
by: Noozer | last post by:
We have a web based tool used to report issues in our office. Many times the users do not enter the required information to deal with the issue. Unfortunately we don't have control of this application to update or modify it. I would like to create another web based tool where users would fill out a form, click submit and the info from that form would be inserted to a specifically named textarea box in a separate IE window. A couple of...
1
4498
by: mhawkins19 | last post by:
I have a form built and on the onclick event I validate all of the fields and then if the form is ok, on the submit event I run a javascript function to set a cookie and download a file from the current window. I have a cgi script provided by my web host to send the contents of the form through email but they only show me how to use the cgi script to send email through the submit event of the form. ie. <form name="downloadform"...
1
11591
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution. ...
8
9027
by: Bishoy George | last post by:
how to let javascript code understand txtUser.Text? in window.open("WebForm26.aspx?User=txtUser.Text",.....................)
11
11872
by: Mike | last post by:
Is there an Immediate window in vb.net 2003? If so, how do you bring it up?
3
4099
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
14
2295
by: Professor Yonce | last post by:
I have made form for E-Mail. I have entered code but the Import system does not work. It has squiggly line underneath it showing it is not communicating. It Will not build. Public Class Form3Bio1 System.Net.Mail.SmtpClient Imports System.Net.Mail ' This line before ' does not work. I have the rest of code to try if and when I am able to get System working. ' I XXX out certain entrys below just for this publication.
6
2842
by: Frank Rizzo | last post by:
I am using the Immediate Window a lot to see the progress of the application. In VS2003, if your cursor was at the very bottom, the window would scroll down whenever something new showed up. If your cursor was somewhere in the middle of the text output, then there would be no scrolling. In VS2005, the Immediate Window scrolls regardless of where the cursor is which is very annoying. Sometimes you want to go back up in the window to...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10023
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9067
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7561
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5583
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2935
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.