Are fields in tables textboxes ??

S

SpookiePower

I'm searching through my form, looking for textboxes
using this code -

For Each ctlC In Me.Controls
If ctlC.ControlType = acTextBox Then
.....
.....

But I also want it to search through the tabel-fields I have
in a subform on my main form. When I'm in edit-mode
I can se the fields are textboxes, but it does not seems
to search through these table-fields.

What do I do wrong ?



www.photo.activewebsite.dk
 
G

Guest

At runtime, Me refers to controls collection of the parent form only. you
have to referecne the controls collection of the subform in order to loop
through it.

Try this instead from the parent form:

Dim i As Integer
For i = 0 To [subform_Name].Form.Controls.Count - 1
MsgBox "This is control " & [subform_Name].Form.Controls.item(i).name
Next
 

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