Highlight field background in continuous form

前端 未结 2 976
南旧
南旧 2021-01-21 15:07

I have an Access continuous form. I would like to change the forecolor of a specific record\'s field.

I have the field to highlight from the FieldModified field. So for

2条回答
  •  礼貌的吻别
    2021-01-21 15:55

    You can't use a String variable like this, fldName is an identifier holding a String value.. not an identifier - in Me.ControlName, both Me and ControlName are identifiers.

    But not all hope is lost! You can use a String to pull a Control object from a form!

    All form controls should exist in the form's Controls collection, keyed by name:

    Me.Controls(fldName).ForeColor = vbRed
    

提交回复
热议问题