regarding ado database

deepakaa
12-15-2003, 06:12 AM
hello guys..

in my application i m using ado database and to let users modify old data i m opening the data to the text box using following statement

Form1.txtnofiles.Text = adorecordset_recevoi.Fields("nofiles")

but on execution it gives error 'non authorised use of Null'...pls tell me what is this error and how to get rid of it...

thanx...

joenuvo
12-15-2003, 06:14 AM
Try

Form1.txtnofiles.Text = IIF(IsNull(adorecordset_recevoi.Fields("nofiles")), "", adorecordset_recevoi.Fields("nofiles"))

deepakaa
12-15-2003, 06:21 AM
thanx buddy for the rply but its not working and giving some error....

msmeth
12-15-2003, 06:30 AM
hello guys..

in my application i m using ado database and to let users modify old data i m opening the data to the text box using following statement

Form1.txtnofiles.Text = adorecordset_recevoi.Fields("nofiles")

but on execution it gives error 'non authorised use of Null'...pls tell me what is this error and how to get rid of it...

thanx...

Try:

Form1.txtnofiles.Text = "" & adorecordset_recevoi.Fields("nofiles")

VeRiTo
12-15-2003, 06:59 AM
Hey msmeth! Try this simple function:


Public Function NullToEmpty(vValue As Variant) As Variant
If Not IsNull(vValue) Then
NullToEmpty = vbNullString
Else
NullToEmpty = vValue
End If
End Function

...
Form1.txtnofiles.Text = NullToEmpty(adorecordset_recevoi.Fields("nofiles"))
...


good luck!
bye

msmeth
12-15-2003, 07:03 AM
Hi Verito! Thanks, but it's not for me....I hope deepaka finds it useful though ;)

Hey msmeth! Try this simple function:


Public Function NullToEmpty(vValue As Variant) As Variant
If Not IsNull(vValue) Then
NullToEmpty = vbNullString
Else
NullToEmpty = vValue
End If
End Function

...
Form1.txtnofiles.Text = NullToEmpty(adorecordset_recevoi.Fields("nofiles"))
...


good luck!
bye

VeRiTo
12-15-2003, 07:06 AM
:)
deepakaa i made a mistake, replace:

If Not IsNull(vValue) Then


for


If IsNull(vValue) Then


:)
good luck!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum