dynamically retrieve form/report fields

A

Angie Southwould

From visual basic, I want to access the field names on
forms and reports stored in an mdb.

I've previously written code that will accomplish this
task from the same database. This chunk of code was in a
function that was run remotely via dde:

set ldb = currentdb
docmd.openform formname, acdesign, , , acreadonly, achidden
set lform = forms(formname)
set lrs = ldb.openrecordset(lform.recordsource)
for each lfield in lrs.fields
x = lfield.name
next
docmd.close acform, formname, acsaveno

Now, I'm looking for the ability to do the same thing
remotely from vb code. I'd like to adhere to these
constraints if possible:
1. I don't want to the user to detect that I've opened and
closed their database; I want the process to appear more
smooth.
2. I don't want to add any code to the user's database (as
I did in the previous version of this software). I'd like
this all to be run from vb.

Thanks in advance for any suggestions. -Angie
 

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