Count property?

B

Bob Quintal

=?Utf-8?B?QWNjZXNzTWFu?= <[email protected]>
wrote in
I have a form with a subform, and for some reason I am
prevented from entering more than 10 records on the subform.
I get a key violation error. I've verified that I can enter
more than 10 records directly into the table without the
subform.

I am using some VBA code with the BeforeUpdate event on the
subform (Nz(DMax ...) to set a sequential value to a subform
key field. This works fine until I get to the 11th record,
and I have no idea why. I'm in panic mode!

While looking at my VBA code I did happen to notice in the
Properties window for the subform that the Count property was
equal to 11. Could this have something to do with it? How is
this property managed?

Thanks!
Does the subform table have a limit on the size of the key? is
it possibly being truncated to a single digit, where ID X-11
gets cut to X-11?
 
G

Guest

I have a form with a subform, and for some reason I am prevented from
entering more than 10 records on the subform. I get a key violation error.
I've verified that I can enter more than 10 records directly into the table
without the subform.

I am using some VBA code with the BeforeUpdate event on the subform (Nz(DMax
....) to set a sequential value to a subform key field. This works fine until
I get to the 11th record, and I have no idea why. I'm in panic mode!

While looking at my VBA code I did happen to notice in the Properties window
for the subform that the Count property was equal to 11. Could this have
something to do with it? How is this property managed?

Thanks!
 
J

John W. Vinson

I am using some VBA code with the BeforeUpdate event on the subform (Nz(DMax
...) to set a sequential value to a subform key field. This works fine until
I get to the 11th record, and I have no idea why. I'm in panic mode!

Please post your code. There's clearly something wrong with it, and we can't
see it from here!

John W. Vinson [MVP]
 
G

Guest

No, the underlying table will accept more than 10 records if entered
manually. This problem went away when I introduced the new field that I
mentioned in my other post. I posted this question separately because I
originally thought it was unrelated to the nz(dmax()) statement.

What is that Count property all about anyway? It couldn't be a coincidence
that it was set to the same value as the limit of records that I could enter.

Thanks for weighing in Bob, and thanks to John as well. What a resource
this is!!!
 
B

Bob Quintal

=?Utf-8?B?QWNjZXNzTWFu?= <[email protected]>
wrote in
No, the underlying table will accept more than 10 records if
entered manually. This problem went away when I introduced
the new field that I mentioned in my other post. I posted
this question separately because I originally thought it was
unrelated to the nz(dmax()) statement.

What is that Count property all about anyway? It couldn't be
a coincidence that it was set to the same value as the limit
of records that I could enter.

the count property of a form is the number of rows in it's
recordsource (+ 1 if you can add new ones).
Thanks for weighing in Bob, and thanks to John as well. What
a resource this is!!!

Bob Quintal said:
=?Utf-8?B?QWNjZXNzTWFu?=

Does the subform table have a limit on the size of the key?
is it possibly being truncated to a single digit, where ID
X-11 gets cut to X-11?
 

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