Hallo , i have a problem here...
I have two forms (F_Object, F_Images) and data sources for forms (T_Objects, T_Images)... F_Images is subform from F_Objecs, and its linked by Obj_id ... like T_Object.ID = T_Images.Obj_ID ...
When I try to open T_Images form for Insert, i get a very first record (Obj_ID), not a new current record.where could be a problem here ???
Private Sub Form_Open(Cancel As Integer)
Dim I As Integer
Dim RS As DAO.Recordset
Dim OBJ As String
OBJ = Me.OpenArgs
MsgBox OBJ
Set RS = Me.RecordsetClone
RS.FindFirst "Obj_ID = " & OBJ
If RS.NoMatch Then
CurrentDb.Execute "INSERT INTO T_Images ([Obj_ID]) VALUES ('" & OBJ & "')"
Else
MsgBox RS.Bookmark
Me.Bookmark = RS.Bookmark
End If
For I = 1 To 10
setImagePath (I)
Next I
End Sub
I have two forms (F_Object, F_Images) and data sources for forms (T_Objects, T_Images)... F_Images is subform from F_Objecs, and its linked by Obj_id ... like T_Object.ID = T_Images.Obj_ID ...
When I try to open T_Images form for Insert, i get a very first record (Obj_ID), not a new current record.where could be a problem here ???
Private Sub Form_Open(Cancel As Integer)
Dim I As Integer
Dim RS As DAO.Recordset
Dim OBJ As String
OBJ = Me.OpenArgs
MsgBox OBJ
Set RS = Me.RecordsetClone
RS.FindFirst "Obj_ID = " & OBJ
If RS.NoMatch Then
CurrentDb.Execute "INSERT INTO T_Images ([Obj_ID]) VALUES ('" & OBJ & "')"
Else
MsgBox RS.Bookmark
Me.Bookmark = RS.Bookmark
End If
For I = 1 To 10
setImagePath (I)
Next I
End Sub