L
LisaB
If I want to run this function where I bring in the field name, how do I
substitute the fieldname with the variable name. For example: in the
function below I want to replace !Title with the variable FieldName. How do
I reference it
--------------------------
Function ChangeFieldValue (FieldName as string, Value as string)
Set dbs = OpenDatabase("Northwind.mdb")
Set rst = dbs.OpenRecordset("TableName", dbOpenDynaset)
With rst
.Edit
!Title = Value
.Update
End With
I want it this but I get an error
With rst
.Edit
!FieldName = Value
.Update
End With
substitute the fieldname with the variable name. For example: in the
function below I want to replace !Title with the variable FieldName. How do
I reference it
--------------------------
Function ChangeFieldValue (FieldName as string, Value as string)
Set dbs = OpenDatabase("Northwind.mdb")
Set rst = dbs.OpenRecordset("TableName", dbOpenDynaset)
With rst
.Edit
!Title = Value
.Update
End With
I want it this but I get an error
With rst
.Edit
!FieldName = Value
.Update
End With