How can VBA learn whether a TextBox is bound?

C

Composer

Sorry, I did try to find an answer in previous threads...

I'm writing a Sub which receives as a parameter
Me.Section(acDetails).Controls for a report.

My sub needs to do certain things with the bound TextBox controls, and
different things with the unbound TextBox controls.

How can it tell which of the TextBox controls is bound?

Thanks.
 
M

Marshall Barton

Composer said:
Sorry, I did try to find an answer in previous threads...

I'm writing a Sub which receives as a parameter
Me.Section(acDetails).Controls for a report.

My sub needs to do certain things with the bound TextBox controls, and
different things with the unbound TextBox controls.

How can it tell which of the TextBox controls is bound?

For K = 0 To arg.Count - 1
If arg.Item(K).ControlSource = "" Then
' unbound
ElseIf Left(arg.Item(K).ControlSource, 1) = "=" Then
' expression
Else
' bound
End If
Next K
 
Top