I am having a problem converting VBA from 2007 to 97. I keep getting a Type Mismatch error. I recieve the error when referencing Tech_ID. In the Table this is a long integer I have tried dim Tech_ID as Long with no help...Any assistance you can give would be helpful....here is my code.
Sub Associate1()
Dim dbs
Set sys = CreateObject("EXTRA.System")
Set Sess = sys.activesession
Set MyScreen = Sess.Screen
' Inside so screen
Dim inc
inc = 7
Dim Tech_Id
Dim RACF
Dim ATM
Dim TM
Dim Ors
Set dbs = CurrentDb
Dim LastName
Set Ors = CurrentDb.OpenRecordset("qry_TechnicianInfo")
With Ors
While Not .EOF
Tech_Id = .fields("AssociateNumber")
'If Tech_Id Is Not Null Then
MyScreen.SendKeys ("I")
waitclock
MyScreen.SendKeys ("<Down>")
waitclock
This is where the error occurs ====> MyScreen.SendKeys (Tech_Id + "<enter>")
waitclock
RACF = Trim(MyScreen.getstring(15, 60, 7))
ATM = Trim(MyScreen.getstring(14, 24, 10))
TM = Trim(MyScreen.getstring(17, 24, 7))
If TM = "" Then TM = Null
.Edit
.fields("RACFID") = RACF
.fields("ATMNumber") = ATM
.fields("TechManager") = TM
.Update
MyScreen.SendKeys ("<PF12>")
waitclock
'End If
.MoveNext
Wend
End With
Ors.Close
End Sub
Sub Associate1()
Dim dbs
Set sys = CreateObject("EXTRA.System")
Set Sess = sys.activesession
Set MyScreen = Sess.Screen
' Inside so screen
Dim inc
inc = 7
Dim Tech_Id
Dim RACF
Dim ATM
Dim TM
Dim Ors
Set dbs = CurrentDb
Dim LastName
Set Ors = CurrentDb.OpenRecordset("qry_TechnicianInfo")
With Ors
While Not .EOF
Tech_Id = .fields("AssociateNumber")
'If Tech_Id Is Not Null Then
MyScreen.SendKeys ("I")
waitclock
MyScreen.SendKeys ("<Down>")
waitclock
This is where the error occurs ====> MyScreen.SendKeys (Tech_Id + "<enter>")
waitclock
RACF = Trim(MyScreen.getstring(15, 60, 7))
ATM = Trim(MyScreen.getstring(14, 24, 10))
TM = Trim(MyScreen.getstring(17, 24, 7))
If TM = "" Then TM = Null
.Edit
.fields("RACFID") = RACF
.fields("ATMNumber") = ATM
.fields("TechManager") = TM
.Update
MyScreen.SendKeys ("<PF12>")
waitclock
'End If
.MoveNext
Wend
End With
Ors.Close
End Sub