AccessSQLUser
Programmer
I have a subform and I change the sourceobject of the subform based on a tabcontrol. There is definitely something buggy because sometimes my subform is not being updated. The actual sourceobject is being changed but many times the controls have nothing in them and then when I click around some tabs, they suddenly appear. I found that if I tell it again and again what the LinkChildFields and LinkMasterFields are, it will eventually show me the data. But sometimes I have to repeat it once, and sometimes 10 times. Did anyone come across this bug? Is there anything I could change in my code to remove the bug? Right now the code in the 'Change' event of the tabcontrol is this:
With Me!subFormName
Select Case Me!Views
Case 0
.LinkChildFields = "ID"
.LinkMasterFields = "ID"
.SourceObject = "subForm1"
Case 1
.LinkChildFields = "ID"
.LinkMasterFields = "ID"
.SourceObject = "subForm2"
...
End Select
End With
With Me!subFormName
Select Case Me!Views
Case 0
.LinkChildFields = "ID"
.LinkMasterFields = "ID"
.SourceObject = "subForm1"
Case 1
.LinkChildFields = "ID"
.LinkMasterFields = "ID"
.SourceObject = "subForm2"
...
End Select
End With