Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: NULL VALUES


Message #1 by "George Oro" <george@c...> on Mon, 27 Jan 2003 16:45:23 +0400
Hi Guys,

I have this scenario on my Unbound Data entry form (ADO)

On Save I have this code which is working to insert the new record

	'Connection / rs defined here...
	rs.addnew
	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type
      If Not IsNull(Me.M11Owner) Then rs("M11Owner") = Me.M11Owner
	etc...
	rs.update

Basically, null fields are ignored...

On the same form I have a search field that will search on my rs based on the criteria i defined. Once the record found then
populate accordingly.
On Edit Click:
All current values will save on each Tag in case of cmdUndo.
After I modified the current record for instance I removed the Company Name (null)
Then I used the same above logic to save the changes i made but it doesn't recognized null (company name) bec. the code ignored null
fields so the changes i made in the company field doesn't saved, not null is OK.

	'Connection / rs / filter defined here...
	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type
      If Not IsNull(Me.M11Owner) Then rs("M11Owner") = Me.M11Owner
	etc...
	rs.update

if i change the line into:
	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type Else rs("M11Type") =""

rs doesn't accept null but on my table all fields set to accept null. PLEASE HELP

TIA,
George





Message #2 by "zak willis" <zak@z...> on Mon, 27 Jan 2003 13:56:45
> Hi Guys,

I have this scenario on my Unbound Data entry form (ADO)

On Save I have this code which is working to insert the new record

	'Connection / rs defined here...
	rs.addnew
	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type
      If Not IsNull(Me.M11Owner) Then rs("M11Owner") = Me.M11Owner
	etc...
	rs.update

Basically, null fields are ignored...

On the same form I have a search field that will search on my rs based on 
the criteria i defined. Once the record found then
populate accordingly.
On Edit Click:
All current values will save on each Tag in case of cmdUndo.
After I modified the current record for instance I removed the Company 
Name (null)
Then I used the same above logic to save the changes i made but it doesn't 
recognized null (company name) bec. the code ignored null
fields so the changes i made in the company field doesn't saved, not null 
is OK.

	'Connection / rs / filter defined here...
	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type
      If Not IsNull(Me.M11Owner) Then rs("M11Owner") = Me.M11Owner
	etc...
	rs.update

if i change the line into:
	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type Else rs
("M11Type") =""

rs doesn't accept null but on my table all fields set to accept null. 
PLEASE HELP

TIA,
George



I am not quite sure, but it looks like you are entering a zero length 
string into the field. "" - You need to be clear whether you are allowing 
zero length strings, or null values. 

	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type Else rs
("M11Type") = NULL

Regards,
Zak :)
Message #3 by "George Oro" <george@c...> on Mon, 27 Jan 2003 17:52:00 +0400
That's a quick and working reply!!! Why I didn't think about using the "Null" which is my problem ?
maybe i'm just tired working two
projects at the same time or my brain is just null! :)


Thanks Zak

> -----Original Message-----
> From: zak willis [mailto:zak@z...]
> Sent: Monday, January 27, 2003 1:57 PM
> To: Access
> Subject: [access] Re: NULL VALUES
>
>
> > Hi Guys,
>
> I have this scenario on my Unbound Data entry form (ADO)
>
> On Save I have this code which is working to insert the new record
>
> 	'Connection / rs defined here...
> 	rs.addnew
> 	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type
>       If Not IsNull(Me.M11Owner) Then rs("M11Owner") = Me.M11Owner
> 	etc...
> 	rs.update
>
> Basically, null fields are ignored...
>
> On the same form I have a search field that will search on my rs based on
> the criteria i defined. Once the record found then
> populate accordingly.
> On Edit Click:
> All current values will save on each Tag in case of cmdUndo.
> After I modified the current record for instance I removed the Company
> Name (null)
> Then I used the same above logic to save the changes i made but it doesn't
> recognized null (company name) bec. the code ignored null
> fields so the changes i made in the company field doesn't saved, not null
> is OK.
>
> 	'Connection / rs / filter defined here...
> 	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type
>       If Not IsNull(Me.M11Owner) Then rs("M11Owner") = Me.M11Owner
> 	etc...
> 	rs.update
>
> if i change the line into:
> 	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type Else rs
> ("M11Type") =""
>
> rs doesn't accept null but on my table all fields set to accept null.
> PLEASE HELP
>
> TIA,
> George
>
>
>
> I am not quite sure, but it looks like you are entering a zero length
> string into the field. "" - You need to be clear whether you are allowing
> zero length strings, or null values.
>
> 	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type Else rs
> ("M11Type") = NULL
>
> Regards,
> Zak :)
>

Message #4 by "zak willis" <zak@z...> on Mon, 27 Jan 2003 16:38:21
No problems. 
Zak
> That's a quick and working reply!!! Why I didn't think about using 
the "Null" which is my problem ? maybe i'm just tired working two
projects at the same time or my brain is just null! :)


Thanks Zak

> -----Original Message-----
> From: zak willis [mailto:zak@z...]
> Sent: Monday, January 27, 2003 1:57 PM
> To: Access
> Subject: [access] Re: NULL VALUES
>
>
> > Hi Guys,
>
> I have this scenario on my Unbound Data entry form (ADO)
>
> On Save I have this code which is working to insert the new record
>
> 	'Connection / rs defined here...
> 	rs.addnew
> 	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type
>       If Not IsNull(Me.M11Owner) Then rs("M11Owner") = Me.M11Owner
> 	etc...
> 	rs.update
>
> Basically, null fields are ignored...
>
> On the same form I have a search field that will search on my rs based on
> the criteria i defined. Once the record found then
> populate accordingly.
> On Edit Click:
> All current values will save on each Tag in case of cmdUndo.
> After I modified the current record for instance I removed the Company
> Name (null)
> Then I used the same above logic to save the changes i made but it 
doesn't
> recognized null (company name) bec. the code ignored null
> fields so the changes i made in the company field doesn't saved, not null
> is OK.
>
> 	'Connection / rs / filter defined here...
> 	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type
>       If Not IsNull(Me.M11Owner) Then rs("M11Owner") = Me.M11Owner
> 	etc...
> 	rs.update
>
> if i change the line into:
> 	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type Else rs
> ("M11Type") =""
>
> rs doesn't accept null but on my table all fields set to accept null.
> PLEASE HELP
>
> TIA,
> George
>
>
>
> I am not quite sure, but it looks like you are entering a zero length
> string into the field. "" - You need to be clear whether you are allowing
> zero length strings, or null values.
>
> 	If Not IsNull(Me.M11Type) Then rs("M11Type") = Me.M11Type Else rs
> ("M11Type") = NULL
>
> Regards,
> Zak :)
>


  Return to Index