473,399 Members | 3,603 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,399 software developers and data experts.

using form to display a variable in a module

hi,

I read couple of emails in the group regarding using the form to
display a message (instead of MsgBox which needs user input to be
closed). I'm not very familiar with forms, I would appreciate if
someone can add couple of codes to my code in order to display the
variable "counter" in a form.

Thanks in advance,
Arash
Here's my code:
Sub template()

Dim dbs As Database, Table As Recordset
Dim counter As Long

Set dbs = CurrentDb

counter = 1
Do While True

mycode .....
counter = counter + 1
Loop

End Sub
Nov 12 '05 #1
1 4771
ma*****@uiuc.edu (Arash) wrote in message news:<99*************************@posting.google.c om>...
hi,

I read couple of emails in the group regarding using the form to
display a message (instead of MsgBox which needs user input to be
closed). I'm not very familiar with forms, I would appreciate if
someone can add couple of codes to my code in order to display the
variable "counter" in a form.

Thanks in advance,
Arash
Here's my code:
Sub template()

Dim dbs As Database, Table As Recordset
Dim counter As Long

Set dbs = CurrentDb

counter = 1
Do While True

mycode .....
counter = counter + 1
Loop

End Sub

Here's a simple way to do what you want.
Create a label called lblStatus on the form.
I like formatting the label to red text.

Dim dbs As Database
Dim counter As Long
Dim strDisplay As String

Set dbs = CurrentDb

Do While True

mycode .....
counter = counter + 1
strDisplay = CStr(counter)
'Just show every ten. There are lots of possibilities here,
'but I'm on vacation :-).
If Right(strDisplay,1) = "0" Then
lblStatus.Caption = strDisplay
DoEvents
End If
Loop

James A. Fortune
Nov 12 '05 #2

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

Similar topics

9
by: Charley Kyd | last post by:
I'm a newbie who needs advice about how to use external files of JavaScript code. I spent an hour this afternoon browsing through JavaScript books at the local book store. In about 15 different...
6
by: Madhusudan Singh | last post by:
Hi I am relatively new to Python. I am using Qt Designer to create a UI for a measurement application that I use. Everything seems to be clear but the use of globals (defined in the module...
2
by: Matt Smolic | last post by:
02.06.04 I need some help displaying a public variable on a form. The variable is declared and initilazied in a module at startup (and declared Public). I have verified this with a...
2
by: Smriti Dev | last post by:
Hi, I am creating a form that allows users' to enter dates and times staff are available for work. They are 2-3 different types of staff. For example, permanent staff that work M-F 9-5 pm...
4
by: http://www.visual-basic-data-mining.net/forum | last post by:
Hi Does anyone know how to stay connected to the server and at the same time i can pass the string to and from the module to the form..... What I want: I put the connection at the...
1
by: bobano | last post by:
Hi everyone, I am writing a POP3 Client program in Perl. You connect to a POP3 Server and have a running conversation with the mail server using commands from the RFC 1939 Post Office Protocol....
4
by: Regnab | last post by:
I've got a form - "frmLookup" (with a subform) that works very happily on its own. The form has a list box, which when updated requeries the subform to display the appropriate results. The...
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
13
JodiPhillips
by: JodiPhillips | last post by:
G'day, I have a silly and simple problem that I need some guidance with. Due to the way our network is set up, I am unable to use the group permissions for Access and have had to implement log...
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?
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
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,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.