Merlene,
Exactly what is it that you are trying to do? Becuase your latest post made it more confusing than the original.
A
ControlSource for a control is the source of the data for the particular control. This can either be a field on a table or data that is derived from another source. Thus the
ControlSource of a text box will take one of two general forms: [FieldName]
(from an underlying Table or Query) or "= A Value or calculated formula"
(that is assigned to the Control and displayed on the form).
Your code above is doing neither, which is why it does not work; but this also begs my original question in this post: "What are you
trying to do?" Because it is not clear.
If you are truly trying to change the Control Source of the text box, then you must assign a Field Name from the underlying Table or Query which is part of the current underlying record source of the form:
- Me.txtPreviousActionPlan1.ControlSource = "Q3Milestone1"
If you are trying to change the value displayed by the text box, then, you ignore the Control Source and simply assign a value to the text box:
- Me.txtPreviousActionPlan1 = _
-
Nz(DLookup("Q3Milestone1", _
-
"TBL_ActionPlan", _
-
"SingleName = '" & [SingleName] & "'"), _
-
"")
Again, it is unclear which you are aiming at.