Are fields in tables textboxes ??

  • Thread starter Thread starter SpookiePower
  • Start date Start date
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
 
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
 
Back
Top