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  

"Invalid use of null" when opening a form in Access 2007



 
 
Thread Tools Display Modes
  #1  
Old June 26th, 2007, 11:08 PM posted to microsoft.public.access.forms
BojanglesWA
external usenet poster
 
Posts: 2
Default "Invalid use of null" when opening a form in Access 2007

I have a form that displays a list of orders. The form has worked fine until
recently when it gave out the "Invalid use of null" error on opening. The
form triggers no events when it opens. I have created a blank database and
imported the tables, forms etc from the original to the blank hoping that the
problem may have been a glitch but that never fixed it. Can anyone help?
  #2  
Old June 26th, 2007, 11:38 PM posted to microsoft.public.access.forms
SteveM
external usenet poster
 
Posts: 383
Default "Invalid use of null" when opening a form in Access 2007

Do you have any fields with DLookup() or another domain aggregate function in
the record source?

If there are no events initiated by the form, it is probably a field looking
up a value or the form's filter setting.

Steve

"BojanglesWA" wrote:

I have a form that displays a list of orders. The form has worked fine until
recently when it gave out the "Invalid use of null" error on opening. The
form triggers no events when it opens. I have created a blank database and
imported the tables, forms etc from the original to the blank hoping that the
problem may have been a glitch but that never fixed it. Can anyone help?

  #3  
Old June 27th, 2007, 12:10 AM posted to microsoft.public.access.forms
BojanglesWA
external usenet poster
 
Posts: 2
Default "Invalid use of null" when opening a form in Access 2007



"SteveM" wrote:

Do you have any fields with DLookup() or another domain aggregate function in
the record source?

If there are no events initiated by the form, it is probably a field looking
up a value or the form's filter setting.

Steve

"BojanglesWA" wrote:

I have a form that displays a list of orders. The form has worked fine until
recently when it gave out the "Invalid use of null" error on opening. The
form triggers no events when it opens. I have created a blank database and
imported the tables, forms etc from the original to the blank hoping that the
problem may have been a glitch but that never fixed it. Can anyone help?



Steve

I cant thank you enough. I had an aggregate function calling on a null
field. I am fairly new to databases and this (obviously) was the first time
I had run into this sort of a problem. Thanks again

Brian
  #4  
Old June 27th, 2007, 12:58 AM posted to microsoft.public.access.forms
SteveM
external usenet poster
 
Posts: 383
Default "Invalid use of null" when opening a form in Access 2007

Glad to help.

Incidentally, to protect against this error in future you can wrap your
domain aggregate function with the Nz() function (if available in your
version).

For a text field: Nz(DLookup("myField","myTable","myCriteria"),"")
For a numeric field: Nz(DLookup("myField","myTable","myCriteria"),0)

If a Null is encounterd, the first will return "" (zero length string) the
second will return '0'.

Steve
"BojanglesWA" wrote:



"SteveM" wrote:

Do you have any fields with DLookup() or another domain aggregate function in
the record source?

If there are no events initiated by the form, it is probably a field looking
up a value or the form's filter setting.

Steve

"BojanglesWA" wrote:

I have a form that displays a list of orders. The form has worked fine until
recently when it gave out the "Invalid use of null" error on opening. The
form triggers no events when it opens. I have created a blank database and
imported the tables, forms etc from the original to the blank hoping that the
problem may have been a glitch but that never fixed it. Can anyone help?



Steve

I cant thank you enough. I had an aggregate function calling on a null
field. I am fairly new to databases and this (obviously) was the first time
I had run into this sort of a problem. Thanks again

Brian

 




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 12:04 AM.


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