I am using a string name to refer to a field in a table. When I plug it into the code, it is not being recognized as a field. I tried to use a Field object, which also didn't work. Here's the code: With rs .Index = "CounselorID" .Seek "=", Val(strCounselor) If .NoMatch Then .AddNew !CounselorID = strCounselor !CategoryIdentifier = intCategory ![(insert string field name value here)] = rsFindWrong![(insert string field name value here)] ![(insert string field name value here)] = rsFindWrong!CountOftxtMID .Update Else... End IF... End With... What should I insert in the brackets to make this work, assuming the string field names are strField1 and strField2?
Change your fields to .Fields(string field name value here) Rob "rs0905" wrote in message news:18566C97-18B7-43D2-BA56-A3F41622E006@microsoft.com... >I am using a string name to refer to a field in a table. When I plug it >into > the code, it is not being recognized as a field. I tried to use a Field > object, which also didn't work. Here's the code: > > With rs > .Index = "CounselorID" > .Seek "=", Val(strCounselor) > If .NoMatch Then > .AddNew > !CounselorID = strCounselor > !CategoryIdentifier = intCategory > ![(insert string field name value here)] = > rsFindWrong![(insert string field name value here)] > ![(insert string field name value here)] = > rsFindWrong!CountOftxtMID > .Update > Else... > End IF... > End With... > > What should I insert in the brackets to make this work, assuming the > string > field names are strField1 and strField2?