My Assistant
![]() ![]() |
|
|
May 9 2004, 01:10 PM
Post
#1
|
|
|
UtterAccess Enthusiast Posts: 78 |
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. |
|
|
|
May 9 2004, 01:18 PM
Post
#2
|
|
|
UtterAccess Guru Posts: 960 From: Yuma, AZ |
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
Post
#3
|
|
|
UtterAccess Enthusiast Posts: 78 |
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
Post
#4
|
|
|
UtterAccess VIP Posts: 3,667 From: Toronto, ON |
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 |
|
|
|
May 10 2004, 07:00 PM
Post
#5
|
|
|
UtterAccess Enthusiast Posts: 78 |
Thanks a lot, xteam.
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th May 2013 - 10:58 AM |