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?
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?