I want to set a varaible to an object but I want the object name to change. I have 3 fields called: field1, field2, and field3 and want to use a varialbe to reference each adding a counter to the end to identify which object. Here is what I have tried. A and B are just numbers. Any ideas?
Dim frm As Object
Dim frmItem as Object
Dim cnt as Integer
cnt = 1
Set frm = Forms!frmItem!fsubItemDetail
Set frmItem = Forms!frmItem!fsubItemDetail!Field & cnt
frm.frmItem = A + B
cnt = cnt + 1
Loop
Dim frm As Object
Dim frmItem as Object
Dim cnt as Integer
cnt = 1
Set frm = Forms!frmItem!fsubItemDetail
Set frmItem = Forms!frmItem!fsubItemDetail!Field & cnt
frm.frmItem = A + B
cnt = cnt + 1
Loop