Run -time error '13': type mismatch

  • Thread starter Thread starter David Mc
  • Start date Start date
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
 
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?
 
Back
Top