Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Mismatch Access 97

Status
Not open for further replies.

Inovate

Technical User
Oct 24, 2006
15
US
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
 
Try

Tech_Id = .fields("AssociateNumber").text

or

MyScreen.SendKeys (Tech_Id)
waitclock
MyScreen.SendKeys ("<enter>")
waitclock

or both of the above




[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
That makes complete sense. Since Tech_ID is an integer when it hits the "+" sign it thinks it should add. Sometimes it just helps to have another set of eyes look at it. Thank you for your help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top