Hi,
Can someone help at all with this problem.
Below is a bit of code I`m using to add a new record to a table. What I am trying to do is cycle through each field I wish to add data to with out actually naming it in this part of the code. The problem Ive got is I cant get the coding '!Fields(lngcounter)' to register unless I put the actual name of the field in here. Does anyone know how to feed a variable into this part of the code? I would e most grateful as this will save me a massive amount of work otherwise.
Thanks in advance.
Ian
------------------------------
With rstTargetTable
.AddNew
Do Until lngcounter = lngNumFields
!Fields(lngcounter) = rstlinkedImport.Fields(lngcounter).Value
lngcounter = lngcounter + 1
Loop
.Update
End With
----------------------------------
Can someone help at all with this problem.
Below is a bit of code I`m using to add a new record to a table. What I am trying to do is cycle through each field I wish to add data to with out actually naming it in this part of the code. The problem Ive got is I cant get the coding '!Fields(lngcounter)' to register unless I put the actual name of the field in here. Does anyone know how to feed a variable into this part of the code? I would e most grateful as this will save me a massive amount of work otherwise.
Thanks in advance.
Ian
------------------------------
With rstTargetTable
.AddNew
Do Until lngcounter = lngNumFields
!Fields(lngcounter) = rstlinkedImport.Fields(lngcounter).Value
lngcounter = lngcounter + 1
Loop
.Update
End With
----------------------------------