Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with continous form view - No control Instance!

Status
Not open for further replies.

rafal444

Programmer
Aug 11, 2006
74
US
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?
 
You might try conditional formating but your options may be slightly limited.
 
Tahnks. I do not know anything about conditional formating, how would I use it exactly for the example above? Will it work?
 
There is no Visibl property in Conditional Formatting, only "Enabled". I do not want to show some fields based on the type combo box. How to do this?
 
A quick and dirty way to use the Conditional Formatting would be to disable the field and change the font color to the background color.

Maybe someone else may have a better method?
 
The problem is that the background is a picture. Can I make background color transparent? What is the color value for transparent?

This seems like serious limitation in Access. This is the second one I have nticed o far. The first one was that the contionous foprm can not have a subform...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top