Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Null Strings

Status
Not open for further replies.

JamesMcG

IS-IT--Management
Jun 16, 2000
31
IE
I field on a form(!) in which the data is has to entered in the right way. I did this quite easily with a lost focus routine but....<br><br>The field in question is text. When there is nothing in it it reads as Null in VB. I have set the zero-string thingy in the table properties but this dosent seem to affect it.<br>I am using an if statment in VB to compare it.<br>i.ie<br><br>if me![ref_number] = null then...<br><br>I know this will always return a Null value when one or both operands are Null.<br><br>Am I missing somthing small????<br><br>Any help greatly appreciated!<br>
 
I'm not sure I understand your question, but this is how I check whether a text field on one of my forms contains data;<br><br>IF len(me!txtField) &gt; 0 THEN... (I often use it in the AfterUpdate event)<br><br>There's always the discussion concerning Empty and Nulls, so you might also check out the IsNull() and IsEmpty() functions in the VB-help.<br><br>
 
If I understand correctly you are trying to stop users from being able to enter null values in a text box?<br>several options<br>set required to yes and allow zero length string to no<br>you can use an inputmask to force data be put a in certain way as well as set the default value to =&quot; &quot;<br>Hope thats helpful
 
Thats exactly what I am trying to do. <br><br>Is there a way of defing custom input masks?<br><br>Thanks
 
ahem....<br>whoops, didnt see that edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top