But, it may be a Microsoft bug!! I have found, and reported, what may be a bug in Microsoft Access 2007. Of course, the developers may decide that it is a feature and it was, in fact, designed that way. But, for now I will rest on my laurels and say that I have found and reported a bug in Access 2007.
Access has a new feature called a split screen. I decided that it would do just exactly what I needed for a customer’s project. And I was correct, it did work correctly. But, then I went one step too far. I wanted to do something that was reasonable.
A split form is one that has allows you to see the data in a form and in a datasheet view simultaneously. It is a handy feature and it worked fine. I decided that I wanted to write some VBA code that would allow me to display only some of the data, depending on what category the record had. Simple solution for the form portion: Simply modify the Visible property of the data field and I had exactly what I wanted.
But, then I decided that I should do a similar thing in the datasheet view. The Visible property would not work. But, I found the ColumnHidden property and that should have done the trick. In fact, it did work sometimes and not others. For those of you tekkies that need to know. It worked if I modified the ColumnHidden property on the form’s Open Event. But, it would not work when the same code was in the event on a form control, like a text box or a button.
It took me a few hours to realize that there was nothing wrong with my code. I even tested it on a very small, uncomplicated form. I repeated my findings – it worked when the form was opening, but not at any other events. So, I submitted a support case to Microsoft yesterday evening.
I got a phone call this morning and was told that the technician was able to repeat my findings. That is always such a good feeling – the problem was not me and my code, someone else can get the same problems!!
So, as I write this, this alleged bug is being reported to the Microsoft Access developers. I await their conclusions. But, I must finish the form I was working on without benefit of their answer. That could be months or years away. I am sure it will be addressed in a future version – well, maybe not!
So, for now I will enjoy the feeling of having found a true bug and start to find the required work-around!