Subform problems

  • Thread starter Thread starter Neil M
  • Start date Start date
N

Neil M

Hi,

I have a subform within a form.
At the top of the form I have filter combo boxes that will change the
subform below, but I have the problem where I select a new filter it auto
adds a blank record to the database table (as it queries the subform)

How do I stop this doing this and only allowing me to add a record when
clickin within the subform (datasheet)

Thanks.
 
Neil,
Seeing a new record at the end of any continuous subform dataset is
normal. It really hasn't "added" a new blank record, but it's there, ready
for data entry. A new record is only created when data is entered and
saved, then a new "New" record is immediately created.

If you must... use the AllowAdditions property of the subform. On the
main form, select the subform object, and in the Enter and Exit events...

Private Sub frmTest1Sub_Enter()
Forms!frmTest1.frmTest1Sub.Form.AllowAdditions = True
End Sub

Private Sub frmTest1Sub_Exit(Cancel As Integer)
Forms!frmTest1.frmTest1Sub.Form.AllowAdditions = False
End Sub
 
Back
Top