Making Some Fields Read-only in Query

Ghaznavi

Registered User.
Local time
Today, 16:25
Joined
Jun 20, 2010
Messages
23
Hi,

I have made a query to select multiple records (of a Yes/No type field in the table). All other fields of the query must be read only except this check box field. An easy solution given is to create a form (in Datasheet view) based on the query and choose NO for Enabled in property box. The problem is, that in this case, I am unable to filter the records (I need two fields to be filtered at least in order to select records and then click the check box in some of them). Kindly advise.
 
you cannot do this in a query. You need to use a form as you have discovered - but try setting the locked property rather than the enabled property
 
You simply need to make a calculated field. You can keep it as a checkbox, but this will require setting a property in the query def. If you are OK with a "TRUE", "FALSE":
Code:
SELECT
 ID,
 IIf([blnField],"TRUE","FALSE") AS NotEditableYesNo
FROM tblDetail;
 
If you need to make your calculated field a checkbox the code is
CurrentDb.queryDefs("QueryName").Fields("FieldName").Properties("DisplayControl") = acCheckBox
 

Users who are viewing this thread

Back
Top Bottom