I am trying to create a for loop, looping through each record in a particular table. Then I want to set the value of each field to a variable and do other calculations with them, then repeat (loop).
I know the code below is way wrong, but I made it "literal" to make it easier to explain what I am trying to do: Items in red are what I am having trouble with
I know the code below is way wrong, but I made it "literal" to make it easier to explain what I am trying to do: Items in red are what I am having trouble with
Code:
Dim ID As Integer
Dim cbName As String
Dim Position As Integer
Dim Temporary As Boolean
for each [COLOR=red]record in "Table1"
[/COLOR] ID = "[COLOR=red]field1".value
[/COLOR] cbName = [COLOR=red]"field2".Value
[/COLOR] Position = [COLOR=red]"field3".Value
[/COLOR] Temporary = [COLOR=red]"field4".value
[/COLOR]
[COLOR=lime] 'Do some other code here[/COLOR]
For [COLOR=red]each record in "Table2"
[/COLOR] If "Field1".value = ID then
[COLOR=lime]'Do more code here[/COLOR]
[COLOR=#00ff00][/COLOR]
End If
Next
Next