Here is some code I wrote that I need help adding a loop.
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("qryWaiting")
strWaiting = rs!Waiting
If strWaiting > 0 Then
DoCmd.OpenForm "frmSplashScreen"
DoCmd.Close acForm, "frmAutoExec"
Else
Call Shell("c:\Step1.bat", 1)
Call Shell("c:\Step2.bat", 1)
DoCmd.SetWarnings True
Application.Quit
End If
here is the frmsplashscreen code
Public intCount As Integer
Private Sub Form_Timer()
If intCount = 500 Then
Call Shell("c:\Step1.bat", 1)
Call Shell("c:\Step2.bat", 1)
DoCmd.SetWarnings True
Application.Quit
Else
intCount = intCount + 1
Me![labelname].Visible = Not Me![labelname].Visible
End If
End Sub
I need to add a counter so that when strwaiting is > 0
I need to loop strwaiting many times.
The problem is I need to have a 60 + second pause so the previous batch files I am calling have time to complete. This is why I open the frmsplash form because it has a counter in it. Can you help add a counter when the strwaiting > 0 condition is met?
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("qryWaiting")
strWaiting = rs!Waiting
If strWaiting > 0 Then
DoCmd.OpenForm "frmSplashScreen"
DoCmd.Close acForm, "frmAutoExec"
Else
Call Shell("c:\Step1.bat", 1)
Call Shell("c:\Step2.bat", 1)
DoCmd.SetWarnings True
Application.Quit
End If
here is the frmsplashscreen code
Public intCount As Integer
Private Sub Form_Timer()
If intCount = 500 Then
Call Shell("c:\Step1.bat", 1)
Call Shell("c:\Step2.bat", 1)
DoCmd.SetWarnings True
Application.Quit
Else
intCount = intCount + 1
Me![labelname].Visible = Not Me![labelname].Visible
End If
End Sub
I need to add a counter so that when strwaiting is > 0
I need to loop strwaiting many times.
The problem is I need to have a 60 + second pause so the previous batch files I am calling have time to complete. This is why I open the frmsplash form because it has a counter in it. Can you help add a counter when the strwaiting > 0 condition is met?