Table property - default value

Egg 'n' Bacon
5StarLounger
Posts: 736
Joined: 18 Mar 2010, 11:05

Table property - default value

Post by Egg 'n' Bacon »

Hi, can someone tell me the appropriate syntax for the Default Value property of a field, that needs to be between 2 numbers; 12 and 28.

NB the filed is set to byte

User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Table property - default value

Post by HansV »

Don't you mean the Validation Rule for the field?

The Default Value property specifies the (single) value that the field will have if you create a new record.
The Validation Rule property specifies a condition that the field's value must satisfy; if not, you won't be able to save the record.
Best wishes,
Hans

Egg 'n' Bacon
5StarLounger
Posts: 736
Joined: 18 Mar 2010, 11:05

Re: Table property - default value

Post by Egg 'n' Bacon »

Doh! :woops:

Of course you are correct; I did mean the Validation Rule property.

Can this between be set in the table, or should I put it into the text box on the form.

Either way, what syntax should I use please.

User avatar
HansV
Administrator
Posts: 78512
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Table property - default value

Post by HansV »

Open the table in design view.
Click in the field.
In the Properties pane, enter the following in the Validation Rule property:

Between 12 And 28

Enter a suitable warning in the Validation Text property, for example:

Please enter a value between 12 and 28.
Best wishes,
Hans

Egg 'n' Bacon
5StarLounger
Posts: 736
Joined: 18 Mar 2010, 11:05

Re: Table property - default value

Post by Egg 'n' Bacon »

Cheers Hans.

Works now I'm putting it into the correct property :)