Q: retrieve control's properties of an external database from code

A

Andrew Coyle

Hi

I was wondering how could I can retrieve the properties of
a control located in an external database using VBA code.

I have found the following snippet of code for determining
if a form exists in the external database:

' See if the name is in the Forms collection.
If objectType = "acForm" Then
test = db.Containers("Forms").Documents
(objectName).Name
If Err <> NAME_NOT_IN_COLLECTION Then
DoesObjectExist = EXIST
End If

But I cannot figure out how to access the controls on that
form

Thanks in advance
A
 
M

Marshall Barton

Andrew said:
Hi

I was wondering how could I can retrieve the properties of
a control located in an external database using VBA code.

I have found the following snippet of code for determining
if a form exists in the external database:

' See if the name is in the Forms collection.
If objectType = "acForm" Then
test = db.Containers("Forms").Documents
(objectName).Name
If Err <> NAME_NOT_IN_COLLECTION Then
DoesObjectExist = EXIST
End If

But I cannot figure out how to access the controls on that
form

The form must be opened before you can get to its
collections and properties. If you're using one mdb to, for
example, document another mdb, then open the form in design
view so you do not inadvertantly invoke any the form's event
propcedures.
 

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