Tabbing into field causes form to go to next record

  • Thread starter Thread starter aronmcdermott via AccessMonster.com
  • Start date Start date
A

aronmcdermott via AccessMonster.com

I have some required fields on a form. I'm checking these fields in the
Form_BeforeUpdate sub. When just clicking on the fields and then trying to
go to the next record by clicking on the little arrow at the bottom of the
form it works as intended (A message box pops up telling the user the field
is required and sets focus to the next field in my If Else statement), but
when I tab into the field (any field) the message box pops up telling the
user the field is required and then goes to the next record. I have no idea
why this happens and I haven't been able to find anything on this. Can
anyone help me here?

Thank you in advance.
 
I'm not CERTAIN I understand exactly what's happening, but I'll suggest
something that works for me and might help eliminate your difficulties.

When I want a field required for a record in a table, I mess with the
field's properties in the table design. But I don't use the provided
'Required' field to do so. I set Required as No, set Allow Zero Length as
No, and make my validation rule "Is Not Null". This has the same effect as
setting Required to 'yes', but this way I can define my own message to the
user in the Validation Text field.

Maybe the way you are checking to make sure the field is not left null is
messing you up. Maybe try not validating data in the BeforeUpdate sub, but
just defining the field properties similar to how I described above???

Hope that helps.
 
ndalton said:
I'm not CERTAIN I understand exactly what's happening, but I'll suggest
something that works for me and might help eliminate your difficulties.

When I want a field required for a record in a table, I mess with the
field's properties in the table design. But I don't use the provided
'Required' field to do so. I set Required as No, set Allow Zero Length as
No, and make my validation rule "Is Not Null". This has the same effect as
setting Required to 'yes', but this way I can define my own message to the
user in the Validation Text field.

Maybe the way you are checking to make sure the field is not left null is
messing you up. Maybe try not validating data in the BeforeUpdate sub, but
just defining the field properties similar to how I described above???

Hope that helps.

Thanks for the reply ndalton. Yes I am doing this with some of the fields on
my form but I don't think that will work for this set of fields as the fields
on this section of the form are not always required. To make it easier to
understand: This section is the "Complaints" section of the form. There are
about 20 fields total and 9 that are required. The 9 that are required are
only required if the user wants to file a "Complaint". So if the user
doesn't fill out any of the fields in this "Complaints" section then the rest
of the fields in this section are not required. I hope that made sense.
I've also discoved while unit testing that if I click yes (on the message box
that pops up for a requied field) multiple times if trying to go to the next
record, it will sometimes go to the next record. This is getting very
frustrating to say the least. Any other ideas?

Thanks again.
 
Back
Top