I currently have my Conditional Formatting expressions hard-coded on a subform. An example is as follows:
ControlName Rule 1 Rule 2
qryIS-1.Loc Value <> [tblqryIS-1c.Loc ] Expression is IsNull([tblqryIS-1c.Loc])
qryIS-1.Type Value <> [tblqryIS-1c.Type] Expression is IsNull([tblqryIS-1c.Type])
qryIS-1.Signal Value <> [tblqryIS-1c.Signal] Expression is IsNull([tblqryIS-1c.Signal])
I have an unbound control ‘txtCFV’ on the main form that correctly returns the subform control names with my prefix as they are entered. Example:
tblqryIS-1c.Loc
tblqryIS-1c.Type
tblqryIS-1c.Signal
My aim is to use the value of txtCFV as a variable in the CF Rule expressions. This will allow my code to be universal. I wouldn’t have to hard-code every form, every modification, etc. Using txtCFV, I modified the CF Rule expressions to:
qryIS-1.Loc Value <> Forms![frmIS-1c]![txtCFV] Expression is IsNull(Forms![frmIS-1c]![txtCFV])
qryIS-1.Type Value <> Forms![frmIS-1c]![txtCFV] Expression is IsNull(Forms![frmIS-1c]![txtCFV])
qryIS-1.Signal Value <> Forms![frmIS-1c]![txtCFV] Expression is IsNull(Forms![frmIS-1c]![txtCFV])
However, this is not working. There are no popup errors.
I read where Access conditional formatting expression cannot directly contain a variable in the traditional sense, but you can achieve a similar effect by using the value of a control on the form within the expression, effectively acting like a variable in the context of that specific form instance. This is what I am trying to achieve.
I have had many attempts at using the Me! self-identifier for this purpose, but none have worked. When Access goes to execute the CF expression, somehow it knows what control it is on. I just don’t know how to capture that.
Any ideas on how to go about this?
ControlName Rule 1 Rule 2
qryIS-1.Loc Value <> [tblqryIS-1c.Loc ] Expression is IsNull([tblqryIS-1c.Loc])
qryIS-1.Type Value <> [tblqryIS-1c.Type] Expression is IsNull([tblqryIS-1c.Type])
qryIS-1.Signal Value <> [tblqryIS-1c.Signal] Expression is IsNull([tblqryIS-1c.Signal])
I have an unbound control ‘txtCFV’ on the main form that correctly returns the subform control names with my prefix as they are entered. Example:
tblqryIS-1c.Loc
tblqryIS-1c.Type
tblqryIS-1c.Signal
My aim is to use the value of txtCFV as a variable in the CF Rule expressions. This will allow my code to be universal. I wouldn’t have to hard-code every form, every modification, etc. Using txtCFV, I modified the CF Rule expressions to:
qryIS-1.Loc Value <> Forms![frmIS-1c]![txtCFV] Expression is IsNull(Forms![frmIS-1c]![txtCFV])
qryIS-1.Type Value <> Forms![frmIS-1c]![txtCFV] Expression is IsNull(Forms![frmIS-1c]![txtCFV])
qryIS-1.Signal Value <> Forms![frmIS-1c]![txtCFV] Expression is IsNull(Forms![frmIS-1c]![txtCFV])
However, this is not working. There are no popup errors.
I read where Access conditional formatting expression cannot directly contain a variable in the traditional sense, but you can achieve a similar effect by using the value of a control on the form within the expression, effectively acting like a variable in the context of that specific form instance. This is what I am trying to achieve.
I have had many attempts at using the Me! self-identifier for this purpose, but none have worked. When Access goes to execute the CF expression, somehow it knows what control it is on. I just don’t know how to capture that.
Any ideas on how to go about this?