Determine ControlSource table

S

sfarkas

I have an application with a number of forms, some of which have a
recordsource that is a join of multiple tables. The forms are all
bound forms. Using VBA, I would like to be able to interate through
the controls on each form and determine: a) the controlsource and b)
the table to which the control is bound. Obviously getting the
controlsource of a control is simple. But I don't see how to drill down
to get the table name to which the control is bound.
Anybody know?

Thanks for your help.
 
P

Paul Overway

Controls aren't bound to a table, they are bound to a field that exists in
the recordsource for your form, which could be either a query or a table.
Aside from parsing the SQL associated with the query used for recordsource,
there is no direct way to obtain the info you seek.
 

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