Run -time error '13': type mismatch

D

David Mc

The error message occurs when i try to load the database.
The purpose of the function is copy a reocrd into a
predefined table called audit.

The operating system used is windows 2000 and access 2000
database.

The error occurs in the line:
Set rstAudit = dbsITExaminations.OpenRecordset("Audit",
dbOpenDynaset)

The full code is below: (thanks in advance)


Sub AddNewAuditDetails(Computer_ID, User_Name,
Startup_Date, Happened)

Dim dbsITExaminations As Database
Dim rstAudit As Recordset
Dim strComputer As String
Dim strUser As String
Dim strStartupDate As String
Dim strWhatHasHappened As String

Set dbsITExaminations = CurrentDb
Set rstAudit = dbsITExaminations.OpenRecordset
("Audit", dbOpenDynaset)

strComputer = Computer_ID
strUser = User_Name
strStartupDate = Startup_Date
strWhatHasHappened = Happened

Audit rstAudit, strComputer, strUser, strStartupDate,
strWhatHasHappened

rstAudit.Close

End Sub
 
R

Robert K.

you dimensioned the date as a string instead of as a
Date? If you need the date as a string, can you use the
CStr(date) function?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top