Updating tables fields indirectly

JesseH

Registered User.
Local time
Today, 11:03
Joined
Apr 24, 2009
Messages
44
I have two tables. I have to copy one to the other using individual field names. I do not know the field names

This is what I have done
Dim dFieldName As Field
For Each dFieldName In dbs.TableDefs!tblOracleARFeedBackErrorsRpt.Fields
rst3!dFieldName.Name = rst!dbfieldname.Name <===problem is here
Next dFieldName
rst3.Update

How do I update each field? dbfieldname contains a valid field name. How do I refer to the field contained in dfieldname.name?

Thanks
 
I'm not clear as to what you are trying to do. Are you copying (appending) data from one table to the other or are you renaming the field names in one table to match those in the other table? If so, what about the other field properties such as datatype?
 
I am copying from one table to the other. I just got it to work. I used the rst3.Fields(dFieldName.Name) = rst.Fields(dFieldName.Name) construct.

Thanks for the help
 
The files are close images of each other. There is only one field that was different - an error field. When the record was read, it was edited. If there was an error, the record was copied to a new table, the error was described and deleted from the original table. This is what the copying of the fields was used for.
Thanks for the help
 

Users who are viewing this thread

Back
Top Bottom