A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Run-Time error '94': Invalid Use of Null??????



 
 
Thread Tools Display Modes
  #11  
Old March 24th, 2007, 08:03 PM posted to microsoft.public.access.forms
missinglinq via AccessMonster.com
external usenet poster
 
Posts: 545
Default Run-Time error '94': Invalid Use of Null??????

Nope! I don't think so!

Private Sub Form_Current()
If Me.NewRecord Then
If IsNull(Me.RecordLock) Then
Response = MsgBox("It's Null")
End If
End If
End Sub

doesn't throw up the messagebox! On the other hand

Private Sub Form_Current()
If Me.NewRecord Then
LockCondition = Me.RecordLock.Value
Response = MsgBox(LockCondition)
End If
End Sub

pops up a messagebox with Me.RecordLock's value of Zero!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via http://www.accessmonster.com

  #12  
Old March 24th, 2007, 08:06 PM posted to microsoft.public.access.forms
missinglinq via AccessMonster.com
external usenet poster
 
Posts: 545
Default Run-Time error '94': Invalid Use of Null??????

Evil,

"Hi I have a record lock function in my form which works fine until I click
New Entry, which would normally start a new blank record. I keep getting the
error message..."

What do you mean by New Entry? Is this a custom command button? If so, what
code do you have behind it?

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via http://www.accessmonster.com

  #13  
Old March 24th, 2007, 08:13 PM posted to microsoft.public.access.forms
ruralguy via AccessMonster.com
external usenet poster
 
Posts: 1,172
Default Run-Time error '94': Invalid Use of Null??????

Do you have a default value for the field set at the table level?

missinglinq wrote:
Nope! I don't think so!

Private Sub Form_Current()
If Me.NewRecord Then
If IsNull(Me.RecordLock) Then
Response = MsgBox("It's Null")
End If
End If
End Sub

doesn't throw up the messagebox! On the other hand

Private Sub Form_Current()
If Me.NewRecord Then
LockCondition = Me.RecordLock.Value
Response = MsgBox(LockCondition)
End If
End Sub

pops up a messagebox with Me.RecordLock's value of Zero!


--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via http://www.accessmonster.com

  #14  
Old March 24th, 2007, 08:24 PM posted to microsoft.public.access.forms
ruralguy via AccessMonster.com
external usenet poster
 
Posts: 1,172
Default Run-Time error '94': Invalid Use of Null??????

MissingLinq,
My testing indicates that a Yes/No field without a default is Null until the
record is Dirty. With a default of No the value is 0 without the record
being Dirty.

missinglinq wrote:
Nope! I don't think so!

Private Sub Form_Current()
If Me.NewRecord Then
If IsNull(Me.RecordLock) Then
Response = MsgBox("It's Null")
End If
End If
End Sub

doesn't throw up the messagebox! On the other hand

Private Sub Form_Current()
If Me.NewRecord Then
LockCondition = Me.RecordLock.Value
Response = MsgBox(LockCondition)
End If
End Sub

pops up a messagebox with Me.RecordLock's value of Zero!


--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200703/1

  #15  
Old March 25th, 2007, 12:12 AM posted to microsoft.public.access.forms
evilcowstare via AccessMonster.com
external usenet poster
 
Posts: 136
Default Run-Time error '94': Invalid Use of Null??????

Hi everyone, it all works fine now but for the people that wanted the details.
..

The checkbox is in the table and now has a default value of Null on top of
the code suggested above with the Nz (if i rememeber).
When i was talking about New Entry I just used the wizard on a button to go
to "New Record". It isnt a customised button.
When I did have the problem I also got the same error message when I went to
the Latest record and clicked next, using navigation buttons made with the
wizard.

Not really sure what the EXACT problem was, all I know is with the table
field saying Null as default and the additional Nz code it works fine.

Thanks to everybody for helping !!!
All the best
Jay

ruralguy wrote:
MissingLinq,
My testing indicates that a Yes/No field without a default is Null until the
record is Dirty. With a default of No the value is 0 without the record
being Dirty.

Nope! I don't think so!

[quoted text clipped - 16 lines]

pops up a messagebox with Me.RecordLock's value of Zero!



--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200703/1

  #16  
Old March 25th, 2007, 03:50 AM posted to microsoft.public.access.forms
missinglinq via AccessMonster.com
external usenet poster
 
Posts: 545
Default Run-Time error '94': Invalid Use of Null??????

No, RuralGuy! I have no default set at table or form level, and as my code
shows it tests as being zero not null!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200703/1

  #17  
Old March 25th, 2007, 03:55 AM posted to microsoft.public.access.forms
missinglinq via AccessMonster.com
external usenet poster
 
Posts: 545
Default Run-Time error '94': Invalid Use of Null??????

"Not really sure what the EXACT problem was, all I know is with the table
field saying Null as default and the additional Nz code it works fine."

Curiouser and curiouser! If at table level the default is Null, and by using
the Nz function in the form code it works, then it should work if both of
these are removed, since Nz essentially neutralizes the Null default!

Of course, the main thing is that you go it to work, and sometimes yuou have
to just settle for that!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200703/1

  #18  
Old March 25th, 2007, 10:36 AM posted to microsoft.public.access.forms
ruralguy via AccessMonster.com
external usenet poster
 
Posts: 1,172
Default Run-Time error '94': Invalid Use of Null??????

What version of Access are you using? Here's the code I was using:

Private Sub Form_Current()

If IsNull([Testing]) Then
MsgBox "Testing is Null"
Else
MsgBox "Testing = [" & [Testing] & "]"
End If

End Sub

I just used the Nav buttons to change records. [Testing] is the Yes/No field
in the table.


missinglinq wrote:
No, RuralGuy! I have no default set at table or form level, and as my code
shows it tests as being zero not null!


--
HTH - RuralGuy (RG for short) acXP WinXP Pro
Please post back to this forum so all may benefit.

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200703/1

  #19  
Old March 25th, 2007, 11:42 AM posted to microsoft.public.access.forms
missinglinq via AccessMonster.com
external usenet poster
 
Posts: 545
Default Run-Time error '94': Invalid Use of Null??????

I'm using Access 2000. If you look closely, you'll see that your code simply
combines the the two pieces of code I posted. When I run yours, the
messagebox pops up stating that Testing = 0! As I said, no defaults are set
at any level.

Ain't Access just grand!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via http://www.accessmonster.com

  #20  
Old March 25th, 2007, 01:56 PM posted to microsoft.public.access.forms
evilcowstare via AccessMonster.com
external usenet poster
 
Posts: 136
Default Run-Time error '94': Invalid Use of Null??????

LOL if it helps im using Access 2002.
Seems to be just something stupid that Access is having a laugh with, Im just
happy the error is gone )
Maybe it was just going on strike over all the code and stuff I have been
making it work out lately, its always the very last thing that you need to do
when it finds fault. Oh well, its all done and complete now, thanks to
everyone that gave me help when I got stuck, especially you missinglinq, your
code saved me more then once )
Hope you all have a fab weekend
All the best
Jay

missinglinq wrote:
I'm using Access 2000. If you look closely, you'll see that your code simply
combines the the two pieces of code I posted. When I run yours, the
messagebox pops up stating that Testing = 0! As I said, no defaults are set
at any level.

Ain't Access just grand!


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200703/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.