View Full Version : Validation help


Samurai
03-30-2005, 04:45 AM
Hi im new round here but am working on a database and sum of the validation rules are confusing me now.

Ok i got a couple of things to ask:

1) What rule do i use to make sure only text is entered into the field, i cant use input masks as the size of the text put into the field will vary, as its names of people.

2) Is there a way to check that all the fields on a form have been entered? So if there not all entered an error appears?

3) Finally, is there a way to reset Autonumbers? or do i have to delete all the records and start frm scratch as my autonumbers have gone abiit crazy as sum records have been deleted so my table looks rather strange.


Thank you, help greatly appreciated :)

KenHigg
03-30-2005, 04:51 AM
1. I have never had a problem with numbers in text flds. If the input person can screw up by putting in a numeric, they can screw up by mis-spelling. So whats the use? Anyway, could there not be a 'John Doe 3rd', etc.

2. In the before update for the form, check the flds for isnull(). Or make the flds required at the table level.

3. Delete all records and comapct & repair (This tip is from Stew :) )

:) Ken

maxmangion
03-30-2005, 04:53 AM
Delete al records and comapct & repair

As far as i know, Access still does not make use of deleted autonumbers.

KenHigg
03-30-2005, 04:57 AM
As far as i know, Access still does not make use of deleted autonumbers.

I don't understand your comment.

:) Ken

maxmangion
03-30-2005, 05:00 AM
what i meant is that when you compact and repair a db, Access does not reset the autonumbers, as he would like to do, but Access simply use the next available number.

KenHigg
03-30-2005, 05:01 AM
what i meant is that when you compact and repair a db, Access does not reset the autonumbers, as he would like to do, but Access simply use the next available number.

It did on the db I just tested it on :)

:) Ken

maxmangion
03-30-2005, 05:09 AM
which version of access are you using, i tried it on access xp, but in 2000 format ... it did not!

Samurai
03-30-2005, 05:28 AM
Jeez thanks for the replies, been a great help.

I get what you mean now actually bout the names thing. I'll just put data entry required to yes.

Is there a way you can change the error message though for that. It comes up with some long message whereas i wud prefer to have a smaller one that i made.

Oh i had no problem deleting the records by the way :).

KenHigg
03-30-2005, 05:30 AM
'02.

I did a simple table with an autonumber fld. Added 7 new records. Then deleted them. Then added a new record and the autonumber fld went to 8. Then I deleted the new rec and comacted the db. When I opened and added a new rec it was back at 1.

:) Ken

maxmangion
03-30-2005, 05:41 AM
I see what you mean Ken, but that happens only of you delete all the records in a table, if you leave at least 1 record, it won't reset.

KenHigg
03-30-2005, 05:45 AM
I see what you mean Ken, but that happens only of you delete all the records in a table, if you leave at least 1 record, it won't reset.

Hum. Didn't try that. Good to know...

:) Ken