Forum Discussion

jefcheek's avatar
jefcheek
New Contributor
14 years ago

Object doesn't support this property or method: Field.AsString

I attempted to run to the sub procedure below in TestComplete but encountered the exception:

Object doesn't support this property or method: Field.AsString



What could be the issue?

--------------------------------------

Sub Unit1



          dim dd, field, combo


          set combo = Sys.Process("Exnet").VCLObject("AccountForm").VCLObject("PageControl1").VCLObject("DetailsPage").VCLObject("GroupBox4").VCLObject("SalespersonCombo")         

          set dd = combo.ListSource.Dataset

          msgbox dd.RecordCount

          set field = dd.FieldByName("STAFFNO")

         

          dd.DisableControls

          dd.First

          msgbox field.AsString

          dd.EnableControls



End Sub

----------------------------------------

combo is a TDBLookupComboBox

2 Replies