C
Charles D Clayton Jr
A2K
I have two tables: tblDrawings & tblRevisions. They have a 1 to many
relationship. I have a form that puts new values into the
tblRevisions but I am noticing something strange. It will generate
two values for the FK. The first one will be a brand new value (and
consequently it is adding a new record to tblDrawings which I do not
want). The second one has the correct value for the FK. So everytime
I want to add one record, it adds two. Here is the code that I am
using,
' Open recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
rst.Source = "qryInputForm_Isos_Rev"
rst.Open Options:=adCmdTable
' Add Revision Info
With rst
.AddNew
.Fields("ID_Isos") = Me.cboInputForm_RevIso.Column(0)
.Fields("rev") = Me.txtRev
.Fields("RevLet") = Me.RevLet
.Fields("Eng") = Me.txtEng
.Fields("DC") = Me.txtDC
.Fields("Date Received") = Me.txtDateReceived
.Update
End With
Does anybody know of a reason for this?
Thanks,
Charles D Clayton Jr
I have two tables: tblDrawings & tblRevisions. They have a 1 to many
relationship. I have a form that puts new values into the
tblRevisions but I am noticing something strange. It will generate
two values for the FK. The first one will be a brand new value (and
consequently it is adding a new record to tblDrawings which I do not
want). The second one has the correct value for the FK. So everytime
I want to add one record, it adds two. Here is the code that I am
using,
' Open recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
rst.Source = "qryInputForm_Isos_Rev"
rst.Open Options:=adCmdTable
' Add Revision Info
With rst
.AddNew
.Fields("ID_Isos") = Me.cboInputForm_RevIso.Column(0)
.Fields("rev") = Me.txtRev
.Fields("RevLet") = Me.RevLet
.Fields("Eng") = Me.txtEng
.Fields("DC") = Me.txtDC
.Fields("Date Received") = Me.txtDateReceived
.Update
End With
Does anybody know of a reason for this?
Thanks,
Charles D Clayton Jr