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