In Access 2000, using VB, I can loop thru fields with sequential names in a table using variables, but having difficulty doing the same with textboxes on a form.
Example with table field names A1, A2...A20
dim n as integer
dim f1 as field
for n = 1 to 20
set f1 = rst.fields("A" & n)
f1 = some value
next n
Example with Textbox names A1, A2...A20
dim n as integer
dim ctl as Control
for n = 1 to 20
For Each ctl In frm.Controls
If ctl.ControlType = acTextBox Then
If ctl.Name = "A" & n Then (x being a variable from 1-20)
ctl.Value = some value
End If
Next ctl
next n
This is sort of a back door route to the results for looping thru the textboxes. Looking for a method similar to the table fields above.
Example with table field names A1, A2...A20
dim n as integer
dim f1 as field
for n = 1 to 20
set f1 = rst.fields("A" & n)
f1 = some value
next n
Example with Textbox names A1, A2...A20
dim n as integer
dim ctl as Control
for n = 1 to 20
For Each ctl In frm.Controls
If ctl.ControlType = acTextBox Then
If ctl.Name = "A" & n Then (x being a variable from 1-20)
ctl.Value = some value
End If
Next ctl
next n
This is sort of a back door route to the results for looping thru the textboxes. Looking for a method similar to the table fields above.