Limite datasheet view to insert only 2 records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. How can i limite datasheet view to insert only 2 records. I want to
insert only two records in one datasheet.

Regards,
Marco.
 
On the On Current Event of the form write the code

If Me.RecordsetClone.RecordCount >= 2 Then
Me.AllowAdditions = False
Else
Me.AllowAdditions = True
End If
 
Thanks. is working perfectly.

Marco




Ofer Cohen said:
On the On Current Event of the form write the code

If Me.RecordsetClone.RecordCount >= 2 Then
Me.AllowAdditions = False
Else
Me.AllowAdditions = True
End If
 
Hello. I'm having a problem here now. In records that has no recordsets or in
new there's no possibility of insert new ones.

That datasheet view is in a subform.

Thanks,
Marco
 
To the MainForm OnCurrent event add the code

If Me.[SubFormName].Form.RecordsetClone.RecordCount >= 2 Then
Me.[SubFormName].Form.AllowAdditions = False
Else
Me.[SubFormName].Form.AllowAdditions = True
End If
 
Back
Top