Hi,
Reading the help section it states that I can use the "Required" and
"AllowZeroLength" properties to prevent users from leaving fields blank.
Those two properties don't seem to appear for fields with data type "Number".
It appears I can only set the "Required" property to Yes for the Number data
type.
The reason I'm asking is because I have a field that holds a Student ID of
type "Number" and that field absolutely cannot be left blank or empty.
Is there a way ( using VB ) to force a field of type Number to assume the
two properties listed above?
-AKA
Shane - 10 Jul 2005 16:50 GMT
Hey Spawn,
I'm certainly no where near an expert so someone my tell you different but
one thought I have is to check to see if StudentID is Null or Empty then you
will know which way to go.
Example:
If Trim(Nz(Me.StudentID,"")) = "" Then
'Do what you need to here incase it's Null or Empty
Else
'Do what you need to here if it's not
End If
HTH,
Shane
>Hi,
>
[quoted text clipped - 11 lines]
>
>-AKA

Signature
Thanks,
Shane
Allen Browne - 10 Jul 2005 17:20 GMT
Number type fields have a required property.
Set it to Yes if you do not want to allow Nulls, i.e. if the user must enter
some number.
A zero-length-string is not a number, and so is not appropriate for a Number
type field.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Hi,
>
[quoted text clipped - 13 lines]
>
> -AKA
Douglas J. Steele - 10 Jul 2005 18:10 GMT
Unless you're doing arithmetic on the Student Id, my suggestion would be to
make it a Text field.
Just because there are only digits in the Id doesn't mean it has to be
stored in a numeric field.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
> Hi,
>
[quoted text clipped - 13 lines]
>
> -AKA
AKA Spawn - 11 Jul 2005 00:21 GMT
Gentlemen,
The StudentID field is actually a Foreign Key to the Student table. I
apologize for not saying this in the original post. So, based on the replies
I have recieved thus far, it appears that I need to follow Allen's path of
setting the "Required" property to "Yes".
I really appreciate the feedback from all who answered this post. All the
suggestions posted here can be used in other areas of my database, so thanks
a million to all of you :-)
-AKA
> Hi,
>
[quoted text clipped - 11 lines]
>
> -AKA