S
Skunk
Please help this amateur.
I have a form containing two subforms (not nested, same level).
Subform 1 displays records on a continuous form, bound to the same query as
its parent, user cannot edit but can select a record via button.
Subform 2 is a single form, bound to table that is not in the above query,
data entry (et al) = yes.
Selection button on subform 1 partially populates subform 2, user fills in
remainder.
My issue: Works great when no record exists in subform 2 table. When I
select a second record in subform 1, the first record is retrieved in subform
2 -- I need a blank/new (except for partial population) record.
My button code is:
Dim rs As Object
Set rs = Forms![2frmCancel].Recordset.Clone
' Find the record that matches the control.
rs.FindFirst "[InvNum] = " & Me![InvNum] & ""
If Not rs.EOF Then Forms![2frmCancel].Bookmark = rs.Bookmark
Parent!lblCancel.Visible = True
Parent!lblClose.Visible = False
Forms![2frmCancel]!CancelEntryfrm.Form!txtInvNum = Parent!txtInvNum
Forms![2frmCancel]!CancelEntryfrm.Form!DateCancelled = Date
[2frmCancel] is the shell containing the subforms.
CancelEntryfrm is subform 2.
Note that on record selection button event I reset [2frmCancel] to the
selected record. This is to update a control on that form.
Can anyone help me with a solution or give me some idea of resolution?
I have a form containing two subforms (not nested, same level).
Subform 1 displays records on a continuous form, bound to the same query as
its parent, user cannot edit but can select a record via button.
Subform 2 is a single form, bound to table that is not in the above query,
data entry (et al) = yes.
Selection button on subform 1 partially populates subform 2, user fills in
remainder.
My issue: Works great when no record exists in subform 2 table. When I
select a second record in subform 1, the first record is retrieved in subform
2 -- I need a blank/new (except for partial population) record.
My button code is:
Dim rs As Object
Set rs = Forms![2frmCancel].Recordset.Clone
' Find the record that matches the control.
rs.FindFirst "[InvNum] = " & Me![InvNum] & ""
If Not rs.EOF Then Forms![2frmCancel].Bookmark = rs.Bookmark
Parent!lblCancel.Visible = True
Parent!lblClose.Visible = False
Forms![2frmCancel]!CancelEntryfrm.Form!txtInvNum = Parent!txtInvNum
Forms![2frmCancel]!CancelEntryfrm.Form!DateCancelled = Date
[2frmCancel] is the shell containing the subforms.
CancelEntryfrm is subform 2.
Note that on record selection button event I reset [2frmCancel] to the
selected record. This is to update a control on that form.
Can anyone help me with a solution or give me some idea of resolution?