May 9 2004, 01:10 PM
Hi. Trying to find how to do something like this:
for each Field in Table
if Field.Name = myName then
Field.Value = "Example"
How do I go about it? Thanks.
May 9 2004, 01:18 PM
Is this just one table, or a number of tables?
Hopefully, it is just one, and you can use the query builder to build an update query to update all values in the myName field to "Example"
May 9 2004, 01:24 PM
It is one table. But the issue is not in updating values. I'm struggling with looping through field names in any given table.
May 9 2004, 01:28 PM
Dim rst as recordset
Set rst = CurrentDb.OpenRecordset("YourTable",dbOpenDynaset)
' here assuming you moved to desired record in your recordset
For Each fldItem In rst.Fields
If fldPO.Name = myName Then
rst(fldItem.Name) = "Example"
May 10 2004, 07:00 PM
Thanks a lot, xteam.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here