Hello from a nubie,
I have a piece of code, written in 1996 and modified slightly through the years.
I have removed all of the miscellaneous, including various error trapping statements. Very consistent failure at the "sbwaitasec" subroutine call.
"Execution of this application has stopped due to a run-time error."
Code works fine on my Win Xp 32 box, fails 100% of the time on Win 7 64 bit.
The win 7 64 bit machine is also using an access runtime (2002 runtime).
Code has worked fine for ~ 15 years in Win 95, 98, XP on 16 and 32 bit machines.
This is a rewrite of code as in 1996 I used something other than dateadd.
Point of code in the program is to give me a short delay while a second piece of softare opens (I know there are other approaches, but 1-2 seconds has been very robust -- and I use 3 -- and can then be checked without going into an infinite loop.)
Specifics: Main is part of form #1, function is part of form #2.
bottom routine is part of a separate module.
all other code, including a shell command before it, are working (validated with multiple "before" and "after" messages. No errors. Some error trapping exists in the real code.)
Main program has had all "kernel32" calls rewritten, as I had an immediate API bug when we first attempted this on the 64 bit machine.
Have tried three calls to subroutine:
Call sbwaitasec(1)
sbWaitasec 1
sbWaitasec(1)
All 3 statements fail on Win 7 (64 bit, runtime only) with the same error message. All work on my machine (full Access, Win XP)
Any thoughts?
Thank you! - John
I have a piece of code, written in 1996 and modified slightly through the years.
Code:
Sub Main() ' in form #1, mouseclick on button brings up form #2,
Dim btest as Boolean
btest = CheckWinWedge
End Sub
' To be clear, I've removed all the other code, leaving just the offending portion.
Function CheckWinWedge() As Boolean ' in form #2, mouseclick on button check for running program...
Dim i As Integer
i = 3
sbWaitaSec i
' waited three seconds, return true
CheckWinWedge = True
End Function
Public Sub sbWaitaSec(iDelta As Integer)
Dim Nsec As Single
Dim iMsgBoxDebug As Integer
Dim iDl As Long
iDl = iDelta
Nsec = DateAdd("s", iDl, Time)
Do Until Time >= Nsec
Loop
End Sub
"Execution of this application has stopped due to a run-time error."
Code works fine on my Win Xp 32 box, fails 100% of the time on Win 7 64 bit.
The win 7 64 bit machine is also using an access runtime (2002 runtime).
Code has worked fine for ~ 15 years in Win 95, 98, XP on 16 and 32 bit machines.
This is a rewrite of code as in 1996 I used something other than dateadd.
Point of code in the program is to give me a short delay while a second piece of softare opens (I know there are other approaches, but 1-2 seconds has been very robust -- and I use 3 -- and can then be checked without going into an infinite loop.)
Specifics: Main is part of form #1, function is part of form #2.
bottom routine is part of a separate module.
all other code, including a shell command before it, are working (validated with multiple "before" and "after" messages. No errors. Some error trapping exists in the real code.)
Main program has had all "kernel32" calls rewritten, as I had an immediate API bug when we first attempted this on the 64 bit machine.
Have tried three calls to subroutine:
Call sbwaitasec(1)
sbWaitasec 1
sbWaitasec(1)
All 3 statements fail on Win 7 (64 bit, runtime only) with the same error message. All work on my machine (full Access, Win XP)
Any thoughts?
Thank you! - John