Disable Addition of Records on Basis of a Control

  • Thread starter Thread starter Faraz A. Qureshi
  • Start date Start date
F

Faraz A. Qureshi

I have a checkbox control in the MAINFORM "CLIENT" named INDIVIDUAL.
I want the SUBFORM "OWNERS", presented in a datesheet form, not to be
showing the starred new record entry row but allowing only a single record to
be entered if the control is Checked, otherwise allow multiple entries.

What piece of VBA would help in this regard?
 
On Tue, 23 Feb 2010 05:17:01 -0800, Faraz A. Qureshi

You MUST show the New Record row to enter the first record, so setting
AllowAdditions to False is not a good idea.
Perhaps in the subform's Form_AfterUpdate you can test for 1 record:
Me.AllowAdditions = (Me.RecordsetClone.RecordCount = 0)
Then repeat this code in the Form_Current event, so AllowAdditions is
set again when you move to another record on the main form.

-Tom.
Microsoft Access MVP
 
Back
Top