Migration Problem

aadebayo

Registered User.
Local time
Today, 19:58
Joined
May 10, 2004
Messages
43
I am currently migrating my Access Application from Access95 to Access2000. I am having problem with the following code.

Sub journal_header(batch_no As Integer, journal_no As String, j_date As Variant, post_year As String)
'2. put values into tbjournal_header
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("tbJOURNAL_HEADER") rst.addnew
rst![batch_number] = batch_no
rst![journal_number] = journal_no
rst![Journal_Date] = Format(j_date, "yy mm dd")
rst![posting_year] = post_year
rst![spare] = " "
rst.UPDATE
rst.Close
End Sub

The red bit throws a Type Mismatch error message. Please help me.
 
First add the Microsoft DAO 3.6 Object Library to your references, then change these:

Dim db As Database
Dim rst As Recordset

to these:

Dim db As DAO.Database
Dim rst As DAO.Recordset
 
Thanks very much. That worked.
 

Users who are viewing this thread

Back
Top Bottom