Hello everybody, lonelyghost again. No major outline here since it's just a simple question that I have no idea how to phrase for a search engine.
Program: Access 2000
OS: Windows XP Professional SP3
Problem: Recording the value and name of each control to a multidimensiona l array.
Does anyone know an easy way to cycle through all of the controls on a form in VB? I already know how to do this:
What I tried (and failed at doing) was setting ctl.Value equal to an entry in an array. The array should be fine since I'm VERY experienced with those. Here's what I tried:
It stopped with an error indicating it didn't know what ctl.Value was. I've gotten this to work in other forms as a button that clears the contents of all text and combo boxes, but I don't know what's wrong with this one.
Program: Access 2000
OS: Windows XP Professional SP3
Problem: Recording the value and name of each control to a multidimensiona l array.
Does anyone know an easy way to cycle through all of the controls on a form in VB? I already know how to do this:
Code:
Dim ctl As Control For Each ctl in Me.Controls [I]insert code here[/I] Next
Code:
Dim ctl As Control, n(1 To 2, 1 To 100) As Variant, i As Byte i = 1 For Each ctl in Me.Controls n(1, i) = ctl.Value n(2, i) = ctl.Name Next
Comment