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