Record Limit

C

Confused Slug

How / can you limit the number of records that may be entered into a sub form
in datasheet view to say 20?

Thanks
Confused
 
A

AccessVandal via AccessMonster.com

There is a way to limit the recordsource query in your form by TOP 20 but I
believe that's not what you want.

Are you saying limit the number of entry/input to the subform so that it does
not exceed 20 records?

One way you can do it in the subform's current event.

Dim rs As DAO.Recordset

Set rs = Me.RecordSetClone

If rs.recordcount = 20 then
me.AllowAddition = False 'disable data entry
End if
Set rs = Nothing
 
T

Tom Lake

Are you saying limit the number of entry/input to the subform so that it
does
not exceed 20 records?

One way you can do it in the subform's current event.

Dim rs As DAO.Recordset

Set rs = Me.RecordSetClone

If rs.recordcount = 20 then
me.AllowAddition = False 'disable data entry

One small thing: That should be

Me.AllowAdditions = False 'disable data entry

Tom Lake
 

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