rost_b
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"
end if
next
How do I go about it? Thanks.
treeless
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"
rost_b
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.
xteam
May 9 2004, 01:28 PM
Dim fldItem
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.Edit
rst(fldItem.Name) = "Example"
rst.Update
Endif
Next
rost_b
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.