I have a main form and subform showing all the related records. It is one to many relationship, so i am showing the subform as continous form
The problem is that if I want to hide certain fields based on the type of record, it hides field for all records. That is not acceptable, since each record would have different type. I figured I need to access instance of teh control for particular record. Something like MyControl(Current Instance).Visible= False. I am not sure what the syntax would be.
Here is my code from Continous Form (hides field for all records):
Select Case cboRoleAType.Value
Case "Distributor"
Me.SalesAgentID_RoleA.Visible = False
Me.DistributorID_RoleA.Visible = True
Case "Sales Agent"
Me.SalesAgentID_RoleA.Visible = True
Me.DistributorID_RoleA.Visible = False
End Select
Seems like .Visible works for all records and once, however .Value returns correct value... Is it a bug in Access?
The problem is that if I want to hide certain fields based on the type of record, it hides field for all records. That is not acceptable, since each record would have different type. I figured I need to access instance of teh control for particular record. Something like MyControl(Current Instance).Visible= False. I am not sure what the syntax would be.
Here is my code from Continous Form (hides field for all records):
Select Case cboRoleAType.Value
Case "Distributor"
Me.SalesAgentID_RoleA.Visible = False
Me.DistributorID_RoleA.Visible = True
Case "Sales Agent"
Me.SalesAgentID_RoleA.Visible = True
Me.DistributorID_RoleA.Visible = False
End Select
Seems like .Visible works for all records and once, however .Value returns correct value... Is it a bug in Access?