R
Robert Solomon
Hi. I have a command button that tries to add a new record to a
subform. This is not working as I would like. The main problem is that
the subform does not display the record just added to the detail table.
How do I fix this?
Thanks.
Dim casesrst, casedetailsrst As Recordset
Set casesrst = CurrentDb.OpenRecordset("Cases")
casesrst.MoveLast
Set casedetailsrst = CurrentDb.OpenRecordset("CaseDetails")
With casedetailsrst
.AddNew
!CasesRef = casesrst!CaseNo
!CPTDescription = "Abd Aorta Vascular Family 3rd order"
!CPTCode = 36247
.Update
.Move 0, .LastModified
End With
casedetailsrst.Close
casesrst.Close
Set casesrst = Nothing
Set casedetailsrst = Nothing
subform. This is not working as I would like. The main problem is that
the subform does not display the record just added to the detail table.
How do I fix this?
Thanks.
Dim casesrst, casedetailsrst As Recordset
Set casesrst = CurrentDb.OpenRecordset("Cases")
casesrst.MoveLast
Set casedetailsrst = CurrentDb.OpenRecordset("CaseDetails")
With casedetailsrst
.AddNew
!CasesRef = casesrst!CaseNo
!CPTDescription = "Abd Aorta Vascular Family 3rd order"
!CPTCode = 36247
.Update
.Move 0, .LastModified
End With
casedetailsrst.Close
casesrst.Close
Set casesrst = Nothing
Set casedetailsrst = Nothing