Public Sub ChangeDisplayControl(QueryName As String, FieldName As String)
Dim qdf As QueryDef
Dim db As DAO.Database
Dim newProp As Property
Dim fld As DAO.Field
Const conPropNotFound As Integer = 3270
On Error GoTo Proc_Err
Set db = CurrentDb
Set qdf = db.QueryDefs(QueryName)
Set fld = qdf.Fields(FieldName)
fld.Properties("DisplayControl").Value = acCheckBox
GoTo Proc_Exit
Proc_Err:
If Err = conPropNotFound Then
Set newProp = fld.CreateProperty("DisplayControl", dbInteger, acCheckBox)
fld.Properties.Append newProp
fld.Properties.Refresh
Else
MsgBox "Some other error occured"
End If
Proc_Exit:
End Sub