0

Hi,

I have used the following code to add a new field to a database. Is there a way to stop this field having a Null value but still keep it empty?

strSQL = "SELECT * FROM cells ORDER BY cell, Proof;"
    Set db = OpenDatabase(lblDatabase.Caption, False, False)


       Set tbl = db.TableDefs("cells")

        ' Create and append new Field objects
        tbl.Fields.Append tbl.CreateField("Extra", dbText, 20)
2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by choudhuryshouvi
0

u can't use both stop entering null value into a field and allow it to keep empty together.instead of u can restrict the user not to enter any blank value to the field.in this case u'll need to check the field whether its current value is blank or not before trying to save it to the database.just fire a lostfocus event of the control in which u are entering the data to check whether the control has some data or not.if yes then save it to the database otherwise throw a msg to the user.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.