validation rule

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Access Training and help » Validation rule?

Validation rule?

resolvedResolved · Low Priority · Version 2003

Daiga has attended:
Access Intermediate course

Validation rule?

Let's say I need to have two fields on my'annual returns' form - Year and specific code (specific vaccination centre number, which is 'autonumber'aswell ). I need to make sure that the centre number doesn't have two records for each year. The centre number is for example '1234' and they are submitting one form for each year, which is then entered on my database. How do I need to set up my databse? Is it a validation rule that I need to define?
Many thanks

RE: validation rule?

Hi Daiga

Thanks for your question

Assuming that the form is taking its data from a single table, the the best option would to make the form's primary key, a compound of year and centre number. This would then mean that you could only ever enter one record per centre per year.

If you have any further problems please do not hesitate to follow up and I'll give you further guidance

Regards

Stephen

Thu 11 Mar 2010: Automatically marked as resolved.


 

Access tip:

Choosing data types in Access

Not sure which data type to use for your Access fields? Here are some guidelines to help you choose a data type to assign to a field.

- The Text data type can accept up to 255 characters. For information that will be recorded in paragraphs, use Memo.

- Also use Text for numbers that aren't going to be used in calculations, e.g. phone numbers.

- Use the Currency data type for monetary amounts.

- Use Date/Time for dates.

- Most other numbers can use the Number data type, but the Field Size property may have to be altered.

- For fields that have only two alternatives (yes, no) use Yes/No data type. If there is likely to be a third entry option (e.g. maybe or don't know) use Text instead.

View all Access hints and tips


Server loaded in 0.08 secs.