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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling controls on a form, but not others 1

Status
Not open for further replies.

PhilClapham

Programmer
Aug 14, 2006
4
GB
Hi all, newbie here so please be kind!

Have a bit of a problem with setting the properties of controls on a form, the situation is a little bit complicated so il explain before going any further.

I am designing a database to store information about the use of network points in our building. Each network point on the wall has 3 connectors. I have designed it such that i have one table to store the names of every network point, then another table containing all the subpoints of each point, with a relationship to enforce this. I have then created a form with a sub-form, so the user can type the name of the network point, and the system then creates 3 records in the sub-form, and displays them. This is done so that all 3 of the sub-points are logged, and none are forgotten. Then, when the sub-point is logged, if it is not in use (chosen via a checkbox) then no further data is needed, so i want to disable all the other inputs for that point.

The problem is that on this sub-form it shows all 3 records at a time, so disabling the controls on the AfterUpdate event of the checkbox disables all of the options, for all 3 sub-points, whereas i want it to just disable those for the current sub-point only. I know the problem lies in the fact that all the controls lie in the same 'detail' level of the form design, but i cant think of a way around this. Any ideas?

Thanks in advance,
Philip Clapham
 
Have you looked at Conditional Formatting?
 
No, i havent, thanks for the tip, but i think i might not be getting how it works, because i copied the controls in the 'detail', and in the Conditional formatting bit put field value is equal to A, then B, then C, but it doesnt seem to have affected it.. any tips on how to use this for what i want to do?
 
For the controls you wish to disable, set:
Condition 1
Expression Is [LoggedFieldName] = True

And click the Enabled icon. This should disable the relevant controls in rows where the [LoggedFieldName] is ticked.
 
oh thats everso close now! it does disable the fields when the checkbox, but if any of the checkboxes (relating to any of the 3 records) are checked then all of the controls are enabled/disabled as the expression sees fit. Any ideas on finishing this off?
 
Wait, my bad, some old code of mine that was attempting to fix this was actually causing this latest problem! Thank you very much for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top