Allowing a date field to be null value 
Author Message
 Allowing a date field to be null value

hi:

I,m writing a software for one of the departments of Louisiana State
university.I have a question regarding this.

I'm using MS Access 2.0 as back end and Visual Basic 4.0 as front end.
I have a mask edit box for the date field and the data type for this has
been declared as date/Time in the table in access.

The system is giving an error message when i leave the date field blank.

How do i overcome this.I want to code in such a way that even if they
don't enter anything in this mask edit box the record should be
accepted.

I would appreciate if you can give me the code.

If you need some more clarifications you can E_mail me.I will be glad to
answer you.

Thanx

ganesh



Thu, 18 Feb 1999 03:00:00 GMT  
 Allowing a date field to be null value

On Sun, 01 Sep 1996 11:37:17 -0500, Ganes Vaidhyanathan

Quote:

>hi:

>I,m writing a software for one of the departments of Louisiana State
>university.I have a question regarding this.

>I'm using MS Access 2.0 as back end and Visual basic 4.0 as front end.
>I have a mask edit box for the date field and the data type for this has
>been declared as date/Time in the table in access.

>The system is giving an error message when i leave the date field blank.

You mean when you attempt to add a new record, yes?

Quote:
>How do i overcome this.I want to code in such a way that even if they
>don't enter anything in this mask edit box the record should be
>accepted.

>I would appreciate if you can give me the code.

>If you need some more clarifications you can E_mail me.I will be glad to
>answer you.

If the field is _not_ part of the primary key, then use Access to correct
the problem.  Bring up Access and open you database.  Select the table
and go into design mode.  Find your field and set the required attribute to
"NO".  That is all there is to it.

If the field  is part of the primary key. Do the above, then set the
atribute for the key to accept null values.

Peter Mikalajunas

http://www.xnet.com/~kd9fb



Fri, 19 Feb 1999 03:00:00 GMT  
 Allowing a date field to be null value

Depends on how your database has been setup.  What is the error message and
what
has the field in question been set up as.  Are NULL allowed on this field,
You must reconsider the design of this field if so. Why is a field that has
been setup for
NO NULL's being set to a NULL.  If you really don't want to have a NOT NULL
constraint on
this field, remove it. Otherwise set the value up properly in the Text box.

While I would not recommend this method, you can try this to get around the
problem
through the back door.
One way around this would be to write code in the LOST_FOCUS event handler
for the
masked test box.  If the Len(text) = 0 then set the text = "" .  This will
force an empty
value to be written to the field.

Best regards
Umesh Murthy



Quote:
> hi:

> I,m writing a software for one of the departments of Louisiana State
> university.I have a question regarding this.

> I'm using MS Access 2.0 as back end and Visual basic 4.0 as front end.
> I have a mask edit box for the date field and the data type for this has
> been declared as date/Time in the table in access.

> The system is giving an error message when i leave the date field blank.

> How do i overcome this.I want to code in such a way that even if they
> don't enter anything in this mask edit box the record should be
> accepted.

> I would appreciate if you can give me the code.

> If you need some more clarifications you can E_mail me.I will be glad to
> answer you.

> Thanx

> ganesh



Sat, 20 Feb 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Re.allowing a date field to take null value

2. Allow A Null Value For A Date Picker

3. Null date values in Date/Time fields in Access DB

4. How do I allow NULL value on a required field in disconnected recordset

5. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

6. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

7. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

8. NULL VALUES IN DATE FIELD - TYPE MISMATCH ERROR

9. Populating Null value in SQL Date/Time field

10. How to give Date fields null values?

11. null value in a field data type as date

12. date field and null values

 

 
Powered by phpBB® Forum Software