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

Error opening a recordset 1

Status
Not open for further replies.

patwadd

Programmer
Nov 29, 2000
6
GB
Can anyone tell me what is wrong with this code?
------------------------
Private Sub Form_Load()
Dim db As Database
Dim rsControl As Recordset
Dim strDownload As String

Set db = CurrentDb
Set rsControl = db.OpenRecordset("Control")
strDownload = rsControl("LastDownload")
MsgBox (strDownload)
End Sub
------------------------
The line "Set rsControl = db.OpenRecordset("Control")" gives an error code 13, Type Mismatch.

"Control" is a table containing just one record.

I am using Access XP and the database is in Access 2000 format.

Thank you
 
Try the modifying your dimensions as follows:

Dim db As DAO.Database
Dim rsControl As DAO.Recordset
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top