F
FKChong
I want to display a running counter on the screen so that the user know that
the program is running and not hang as well as how records have processed. I
use to able to apply the following code in Acees 2003 but not in Access
2007.
Is any one know the reason ? Do you have the Access 2007 code for display
running counter on screen ?
Private Declare Function GetFocus Lib "user32" () As Long
Private Declare Function SetWindowText Lib "user32" Alias
"SetWindowTextA" (ByVal Hwnd _
As Long, ByVal lpString As String) As Long
Private Sub Text0_Click()
Dim a As Long
Dim Hwnd As Long
Dim lngResult As Long
Dim strTest As String
' Get the window handle for the current window.
' That's this TextBox's Window
Hwnd = GetFocus()
Debug.Print Now
'DoEvents
For a = 0 To 10000 Step 1
'Me.Text0 = a
'Me.Repaint
'DoEvents
' Send the message to the current text box
' Updates the TEXT property
lngResult = SetWindowText(Hwnd, a)
Next a
Debug.Print Now
End Sub
the program is running and not hang as well as how records have processed. I
use to able to apply the following code in Acees 2003 but not in Access
2007.
Is any one know the reason ? Do you have the Access 2007 code for display
running counter on screen ?
Private Declare Function GetFocus Lib "user32" () As Long
Private Declare Function SetWindowText Lib "user32" Alias
"SetWindowTextA" (ByVal Hwnd _
As Long, ByVal lpString As String) As Long
Private Sub Text0_Click()
Dim a As Long
Dim Hwnd As Long
Dim lngResult As Long
Dim strTest As String
' Get the window handle for the current window.
' That's this TextBox's Window
Hwnd = GetFocus()
Debug.Print Now
'DoEvents
For a = 0 To 10000 Step 1
'Me.Text0 = a
'Me.Repaint
'DoEvents
' Send the message to the current text box
' Updates the TEXT property
lngResult = SetWindowText(Hwnd, a)
Next a
Debug.Print Now
End Sub