Limit No of records in subform

M

mhmaid

In my InvoiceRegister Main form I have a field for "Number of Invoices" , and
in the subform I will creat a record for each invoice. so what I want is , to
make sure that the number of records in the subform equals the Number of
invoices .
I.e.if Number of Invoices are 10 ,then subform records should not exceed 10.

and also , if it is possible before updating the main form , to make sure
that subform records are complete, no missing record.

hope someone can help
thank you.

thanks to everybody who responded to my previous questions.
 
K

kingston via AccessMonster.com

If your subform is based on a query, you can do this by returning the top X
records. Change the subform's RecordSource to an SQL string like:

Me.Subform.RecordSource = "SELECT TOP 10 Table.* FROM Table;"

You'll have to add this to the AfterUpdate event for Number of Invoices and
wherever else you need it.

Could you go through the logic for what you mean by checking for subform
records so that there aren't missing records? Why would records be missing?
 
M

mhmaid

thanks for response
I will try what you suggested.
I mean by missing that , suppose the number of invoices are 10 , but in the
subform there are only 8 records , that means , there should be 2 more
records to be entered in the subfrom.
 

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