Hi!
In Access 2007, I'm creating a dynaset recordset, which among other fields, contain a multivalue field.
So I have this code:
Dim LocalFilter As DAO.Recordset
Set LocalFilter = CurrentDb.OpenRecordset("SELECT * FROM ProjectFilter WHERE user ='" & CheckUser() & "'", dbOpenDynaset)
If LocalFilter.EOF Then
LocalFilter.AddNew
Else
LokalFilter.MoveFirst
LokalFilter.Edit
End If
Now, I begin to update those fields in the recordset. Every field, but the multivalue field, updates correctly, when I run LocalFilter.Update.
However when I set the multivalue (it's type is Number) like this:
LokalFilter!Fieldname = 443
it gives me this error: "Method 'Collect' of object 'Recordset2' failed"
I wasn't expecting that to work though, as I believe one should use .Value. However:
LokalFilter!Fieldname.Value = 443
gives this error: "Object doesn't support this property or method".
So, how do I put this single value in that multivalue field? - And how can I put in several values to the field??
Please ask if you need more information...
P.S. I don't need recommendations not to use multivalue fields in Access. I know of the troubles it can give me...
In Access 2007, I'm creating a dynaset recordset, which among other fields, contain a multivalue field.
So I have this code:
Dim LocalFilter As DAO.Recordset
Set LocalFilter = CurrentDb.OpenRecordset("SELECT * FROM ProjectFilter WHERE user ='" & CheckUser() & "'", dbOpenDynaset)
If LocalFilter.EOF Then
LocalFilter.AddNew
Else
LokalFilter.MoveFirst
LokalFilter.Edit
End If
Now, I begin to update those fields in the recordset. Every field, but the multivalue field, updates correctly, when I run LocalFilter.Update.
However when I set the multivalue (it's type is Number) like this:
LokalFilter!Fieldname = 443
it gives me this error: "Method 'Collect' of object 'Recordset2' failed"
I wasn't expecting that to work though, as I believe one should use .Value. However:
LokalFilter!Fieldname.Value = 443
gives this error: "Object doesn't support this property or method".
So, how do I put this single value in that multivalue field? - And how can I put in several values to the field??
Please ask if you need more information...
P.S. I don't need recommendations not to use multivalue fields in Access. I know of the troubles it can give me...