I have a table storing path to picture files on the disc.
I have a field for user selected order of the pictures - field name "Sortering".
I want to insert these picture into a WORD-document in the user defined order and use this code:
Code:
Dim tbl As DAO.Recordset
Set tbl = CurrentDb.OpenRecordset("BILLEDE")
With tbl
.Index = .Fields("Sortering")
.FindFirst "PersonID=" & Me.PersonID
If .NoMatch Then Exit Sub
bD.Range(0, 0).Text = "Registrerede billeder:"
Do
bD.Range(End:=Selection.End).Text = .Fields("Billedtekst")
.FindNext "PersonID=" & Me.PersonID
Loop Until .EOF
End With
Set tbl = Nothing
I have tried to open the recordset as you se here without specification, as a dbOpenSnapshot, as a dbOpenDynaset but
NOT ALLOWED to set the index in any of these cases - Error 3251 - not allowed for this objecttype !
I have tried to have the field NOT indexed in the definition, I have tried to HAVE it indexed - same error !
How can I acces the pictures in the user defined order ?