J
James Bertino
I'm trying to update a table. the table has different field names at
different times. I'm using the DAO method and this code;
++++++++++++
With rs
Do While Not .EOF
.Edit
LowerVal = LBound(varFdNames)
UpperVal = UBound(varFdNames)
For i = LowerVal To UpperVal
Debug.Print mPercent
strFdName = "!" & varFdNames(i) ' Gives the value !Field.Name not
!Field.Value
' Get the original string
strText = !Desc
' Get the updated string
!Desc = cleanUpField(strText)
.Update
.Close
Next
mPercent = mPercent + 1
mMeter = SysCmd(acSysCmdUpdateMeter, mPercent)
Loop
End With
+++++++++++++++++
Howerver the DAO object doesn't seem to like passing a varible for the field
name. What I get is the field name and not the field value for the value of
the variable. Is there a way of making this work or should i recreate the
table and pass the value though my procedure for cleaning, then delete the
original table and rename the output table?
thanks in advance
Jay
different times. I'm using the DAO method and this code;
++++++++++++
With rs
Do While Not .EOF
.Edit
LowerVal = LBound(varFdNames)
UpperVal = UBound(varFdNames)
For i = LowerVal To UpperVal
Debug.Print mPercent
strFdName = "!" & varFdNames(i) ' Gives the value !Field.Name not
!Field.Value
' Get the original string
strText = !Desc
' Get the updated string
!Desc = cleanUpField(strText)
.Update
.Close
Next
mPercent = mPercent + 1
mMeter = SysCmd(acSysCmdUpdateMeter, mPercent)
Loop
End With
+++++++++++++++++
Howerver the DAO object doesn't seem to like passing a varible for the field
name. What I get is the field name and not the field value for the value of
the variable. Is there a way of making this work or should i recreate the
table and pass the value though my procedure for cleaning, then delete the
original table and rename the output table?
thanks in advance
Jay