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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Access Run time error 13(more info) 1

Status
Not open for further replies.

hunterjj

IS-IT--Management
Dec 9, 2002
28
US
Following is the code that results in a run time error 13/type mismatch on the SET statement. It is right out of the "Access 97 programming for windows for dummies" book so I don't know what to do. Does this only work on Access 97? Is there a way to make it work on Access 2000?

Private Sub PLastFirst_AfterUpdate()

Dim PlayerInfo As Recordset, SQLText As String

SQLText = "SELECT * FROM [Players] WHERE " _
& "[Players.PLastFirst] = '" & Me.[PLastFirst] & "' "

Set PlayerInfo = CurrentDb.OpenRecordset(SQLText)

Me![PUSGAHcp] = PlayerInfo![PUSGAHcp]

MsgBox "PUSGAHcp = " + Me![PUSGAHcp]

End Sub

While working on a form with a different recordset, this is supposed to return all the data elements in the players table into a recordset variable.

Any ideas?
 
yep same old problem

in the editor window (visual basic) go to the tools menu and look for references. then look in the list for
Microsoft DAO 3.6 object library
choose this and the it should work

after you change this

Private Sub PLastFirst_AfterUpdate()

Dim dbs as DAO.database
Dim PlayerInfo As DAO.Recordset
Dim SQLText As String

SQLText = "SELECT * FROM [Players] WHERE " _
& "[Players.PLastFirst] = '" & Me.[PLastFirst] & "' "

Set dbs = currentdb
Set PlayerInfo = dbs.OpenRecordset(SQLText)

Me![PUSGAHcp] = PlayerInfo![PUSGAHcp]

MsgBox "PUSGAHcp = " + Me![PUSGAHcp]

End Sub
"What a wonderfull world" - Louis armstrong
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top