473,385 Members | 2,005 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.

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 10747
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!Text0="Hi there"
Forms!Form22!Text0=Forms!Form22!Text0 & vbCrLf & "Hi there again"

You could use "Me." instead of "Forms!Form22" 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*********@yahoo.com> wrote in message
news:7e**************************@posting.google.c om...
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(acSysCmdSetStatus, j)
Next
End Sub

After the first Paren -- SysCmd( you get a dropdown with something like
15 selections. acSysCmdSetStatus 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!Text0="Hi there"
Forms!Form22!Text0=Forms!Form22!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
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...
6
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...
1
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...
1
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...
8
by: Bishoy George | last post by:
how to let javascript code understand txtUser.Text? in window.open("WebForm26.aspx?User=txtUser.Text",.....................)
11
by: Mike | last post by:
Is there an Immediate window in vb.net 2003? If so, how do you bring it up?
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
14
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...
6
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...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.