By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,285 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,285 IT Pros & Developers. It's quick & easy.

using form to display a variable in a module

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.