您不能更新字段或(列),您只能更新记录(或行)。但是,您可以确定哪些字段符合您的描述。我不太明白这个问题,但也许您可以将字段名称添加到数组中,然后将数组剥离并仅更新以“TT”开头的字段。查找字段名称的代码如下:
Function TableInfo(strTableName As String)
On Error GoTo TableInfoErr
' Purpose: Display the field names, types, sizes and descriptions for a table.
' Argument: Name of a table in the current database.
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim StrSQL As String
Set db = CurrentDb()
Set tdf = db.TableDefs(strTableName)
For Each fld In tdf.Fields
If Left(fld.name, 2) = "TT" then
'Your field name starts with TT. Do some processing...
StrSQL = "UPDATE " & strTableName & " SET " & fld.Name & " = 1 WHERE " & fld.Name & " = 'Applied'"
DoCmd.Execute StrSQL
End If
Next
TableInfoExit:
Set db = Nothing
Exit Function
TableInfoErr:
Select Case Err
Case 3265& 'Table name invalid
MsgBox strTableName & " table doesn't exist"
Case Else
Debug.Print "TableInfo() Error " & Err & ": " & Error
End Select
Resume TableInfoExit
End Function