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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
"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
|
|||
|
|||
"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
|
|||
|
|||
"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
|
|||
|
|||
"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 | |
|
|