OnLoad Event Error When Allow Additions = No

G

Guest

OnLoad Event Error When Allow Additions = No
This form will not load when the Allow Additions is set to no. When they are
set to yes it loads just fine. It does not give any error it just loads
blank. Is anybody aware of some Onload Event error occuring when Allow
Additions = No?
 
B

Brendan Reynolds

I think you mean that the form does load, but that it is a completely blank
form? This happens when AllowAdditions is set to False and the form's
recordset returns no records. The solution depends on what you want to do
when there are no records. Do you want to allow the user to add a record in
that situation? Then add some code to the form's Open event to set the
AllowAdditions property depending on whether the form's
Recordset.RecordCount property = 0. Otherwise, check the record source to
see if there are any matching records before attempting to open the form.
 
A

Aaron James via AccessMonster.com

When the form comes up as blank, are there 0 records that would be
displayed on the form?
I ran into this same thing (i think) when I restricted a form to
allowadditions = false, and then did a filter that would result in 0
records being returned. As far as I know that is just Access's normal
response. I had to through in a check to make sure my filters didn't
result in 0records before I committed it.
 
G

Guest

Yes that is the problem. Thanks. I will force it to use a predesignated
record if the record set is empty. That way there will always be a record for
the form to display. The reason all of this came about was that the IT
director did not want the HR personel to enter new records into this
particular form. Yet he wanted the NavigationButtons and Record Count to
still be available. So without custom coding my own version of this
"Built-In" Access object I found myself in that situation. Too bad Microsoft
has not provided a way for developers to access this object and manipulate
it. Say in order to just use the record counter or just use the navi buttons
or to disable the "add new" button in the navi button object. Thanks for your
help.
 
G

Guest

Yes that is the problem. Thanks. I will force it to use a predesignated
record if the record set is empty. That way there will always be a record for
the form to display. The reason all of this came about was that the IT
director did not want the HR personel to enter new records into this
particular form. Yet he wanted the NavigationButtons and Record Count to
still be available. So without custom coding my own version of this
"Built-In" Access object I found myself in that situation. Too bad Microsoft
has not provided a way for developers to access this object and manipulate
it. Say in order to just use the record counter or just use the navi buttons
or to disable the "add new" button in the navi button object. Thanks for your
help.
 

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