Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / July 2005

Tip: Looking for answers? Try searching our database.

Nulls And Zero Length Strings

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
AKA Spawn - 10 Jul 2005 16:37 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.