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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top