Limite datasheet view to insert only 2 records

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.
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top