J
James
I have updated an Access database from 97 to 02 and for
some reason this piece of code is giving a type mismatch
when it sets rstATTACH equal to tbl_ATTACH. I have
included a simplified version of subroutine below. Any
help would be much appreciated.
Private Sub btn_FileName_Click()
Dim strInsertFilename As String
Dim dbsData As Database
Dim rstATTACH As Recordset
Dim booRecordAdded As Boolean
Set dbsData = CurrentDb()
Set rstATTACH = DbData.OpenRecordset("tbl_ATTACH")
InsertFilename = OpenFiles()
If Not IsEmpty(strInsertFilename) Then
_strInsertFilename = "#" & Left$(strInsertFilename,
_InStr(strInsertFilename, Chr(0)) - 1) & "#"
rstATTACH.AddNew
rstATTACH!Work = Me.REF
rstATTACH!Attachment = strInsertFilename
rstATTACH.Update
booRecordAdded = True
End Sub
some reason this piece of code is giving a type mismatch
when it sets rstATTACH equal to tbl_ATTACH. I have
included a simplified version of subroutine below. Any
help would be much appreciated.
Private Sub btn_FileName_Click()
Dim strInsertFilename As String
Dim dbsData As Database
Dim rstATTACH As Recordset
Dim booRecordAdded As Boolean
Set dbsData = CurrentDb()
Set rstATTACH = DbData.OpenRecordset("tbl_ATTACH")
InsertFilename = OpenFiles()
If Not IsEmpty(strInsertFilename) Then
_strInsertFilename = "#" & Left$(strInsertFilename,
_InStr(strInsertFilename, Chr(0)) - 1) & "#"
rstATTACH.AddNew
rstATTACH!Work = Me.REF
rstATTACH!Attachment = strInsertFilename
rstATTACH.Update
booRecordAdded = True
End Sub