I have an Access 2010 database that is based on MS SQL Server through ODBC. There are a some times when I will open a form that has a subform and I will go to a record where there is no data in the related table for the current record and the subform will not be there. The box for the control is there, but the subform is not. This doesn't always occur, which makes it tough for me to figure out what is the common denominator that makes it work once and then not another time. I have never had trouble with this when using Access as the backend so I'm assuming that there is something with either MS SQL Server or just ODBC connections in general that is causing this.
One example of this happening consistently is when I add a user, the subform is only visible if they are a certain type of user. When first creating the user, I have the subform set to visible = False. In the EmployeeType combobox's AfterUpdate event I check to see if the type selected was the type that needs this subform and if it is, then I make the subform visible. When this happens, only the subform control become visible, but not the form (which is empty this this is a new employee being entered). I have to go to another employee's record and then come back to the one I just created and then I see the sub form itself and can add the data needed in it. This happens every time. There is another situation with a subform on a different form whose Visible property never changes, but occasionally it isn't visible. So far this only occurs when there is no data.
Is there something that I can do to make these subforms always be visible even if there is no data?
One example of this happening consistently is when I add a user, the subform is only visible if they are a certain type of user. When first creating the user, I have the subform set to visible = False. In the EmployeeType combobox's AfterUpdate event I check to see if the type selected was the type that needs this subform and if it is, then I make the subform visible. When this happens, only the subform control become visible, but not the form (which is empty this this is a new employee being entered). I have to go to another employee's record and then come back to the one I just created and then I see the sub form itself and can add the data needed in it. This happens every time. There is another situation with a subform on a different form whose Visible property never changes, but occasionally it isn't visible. So far this only occurs when there is no data.
Is there something that I can do to make these subforms always be visible even if there is no data?
Comment