mloucel
Member
- Local time
- Today, 08:41
- Joined
- Aug 5, 2020
- Messages
- 356
Hello Gurus:
I have a weird issue [not life and dead], I have a database that when I EDIT the record on a form, the user has to press a button to save, I do that so that I have the opportunity to check some fields that the end user MUST fill so I do a quick : "If isnull(XYZ) ", which works many times, but somehow, sometimes it doesn't see the field empty, even though it is empty, just for fun I did a test, I entered a new record and on purpose I left 3 fields empty, my routine detected perfectly 2 of them and somehow the 3rd one, just simply ignore and saved the record, so I went to my EDIT FORM, recall the record and without doing anything I clicked SAVE, and it did, so I recall the record again, I add spaces, saved again, recall and hit the delete key a few times [40 or 50 in a 15 chr field], then hit save, and it did it again, then I add 1 letter, save no problem as it should, then open again and delete the letter, this time gave me the warning..
So I added " If isnull(XYZ) or XYZ="" ", and somehow the error never happened again, coincidence ?, I removed the = "", and after 4 or 5 new records it happened again, I have tried with other fields and get the same issue, so is not just 1 field I have detected at least 2 more.
This only happens when there is a new record, using "DoCmd.GoToRecord , , acNewRec" something is placed in a field and is invisible, but when I use the XYZ="" then the problem is solved, i am forced to use that, but I do not understand why isnull() does not work.
Any Ideas?
I have a weird issue [not life and dead], I have a database that when I EDIT the record on a form, the user has to press a button to save, I do that so that I have the opportunity to check some fields that the end user MUST fill so I do a quick : "If isnull(XYZ) ", which works many times, but somehow, sometimes it doesn't see the field empty, even though it is empty, just for fun I did a test, I entered a new record and on purpose I left 3 fields empty, my routine detected perfectly 2 of them and somehow the 3rd one, just simply ignore and saved the record, so I went to my EDIT FORM, recall the record and without doing anything I clicked SAVE, and it did, so I recall the record again, I add spaces, saved again, recall and hit the delete key a few times [40 or 50 in a 15 chr field], then hit save, and it did it again, then I add 1 letter, save no problem as it should, then open again and delete the letter, this time gave me the warning..
So I added " If isnull(XYZ) or XYZ="" ", and somehow the error never happened again, coincidence ?, I removed the = "", and after 4 or 5 new records it happened again, I have tried with other fields and get the same issue, so is not just 1 field I have detected at least 2 more.
This only happens when there is a new record, using "DoCmd.GoToRecord , , acNewRec" something is placed in a field and is invisible, but when I use the XYZ="" then the problem is solved, i am forced to use that, but I do not understand why isnull() does not work.
Any Ideas?