hansiepansie
New member
- Local time
- Today, 15:14
- Joined
- Aug 25, 2013
- Messages
- 6
Hello Forum,
I want to add a record with attachment to a table in an access (2013) database.
If I ignore the attachment error everything works as it should, but as soon as I add the code for the attachment I receive error code 3259.
Since I have a dutch office version the error text (ongeldig veld gegevenstype) is in dutch, translated it means something like a data type mismatch.
t_first_bars is a field in the table tbl_tune . The field type is attachment.
What am I doing wrong ?
Your reply is highly appreciated,
Hans
I want to add a record with attachment to a table in an access (2013) database.
If I ignore the attachment error everything works as it should, but as soon as I add the code for the attachment I receive error code 3259.
Code:
Private Sub add_tune()
Dim dbtune As DAO.Database
Dim rst_tune As DAO.Recordset
Dim rst_tune_in As DAO.Recordset
Dim rs_child As DAO.Recordset
Set dbtune = CurrentDb
Set rst_tune = dbtune.OpenRecordset("tbl_tune")
Set rst_tune_in = dbtune.OpenRecordset("source_data")
rst_tune_in.MoveFirst
Do Until rst_tune_in.EOF = True
rst_tune.AddNew
rst_tune("t_title").Value = rst_tune_in("title")
file_string = "G:\sibelius\scores\volksmuziek\dans\branl1.jpg"
[COLOR=black]rst_tune.Fields("t_first_bars").LoadFromFile file_string[/COLOR]
rst_tune("t_stamp").Value = Now()
rst_tune.Update
rst_tune_in.MoveNext
Loop
rst_tune.Close
rst_tune_in.Close
Set rst_tune = Nothing
Set rst_tune_in = Nothing
End Sub
Since I have a dutch office version the error text (ongeldig veld gegevenstype) is in dutch, translated it means something like a data type mismatch.
t_first_bars is a field in the table tbl_tune . The field type is attachment.
What am I doing wrong ?
Your reply is highly appreciated,
Hans