chris.blinn799
New member
- Local time
- Yesterday, 18:54
- Joined
- Oct 28, 2009
- Messages
- 4
I'm trying to create a new feature in a feature class, then load it's field data from a form I created. The created feature is a land parcel. Not sure how to fix my "Object Required" error.
Please Help
And thank you to those who helped me with formatting!
Code:
Public Sub UserForm_Initialize()
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
Dim pParcelMaps As IMaps
Set pParcelMaps = pMxDoc.Maps
Dim pParcelMap As IMap
Set pParcelMap = pParcelMaps.Item(0)
Dim pSurveyedAreaFLayerDef As IFeatureLayerDefinition
Set pSurveyedAreaFLayerDef = pParcelMap.Layer(1)
Dim pToDoAreaFLayerDef As IFeatureLayerDefinition
Set pToDoAreaFLayerDef = pParcelMap.Layer(2)
Dim pSurveyedAreaFLayer As IFeatureLayer
Set pSurveyedAreaFLayer = pSurveyedAreaFLayerDef
Dim pToDoAreaFLayer As IFeatureLayer
Set pToDoAreaFLayer = pToDoAreaFLayerDef
Dim pSurveyedAreaFClass As IFeatureClass
Set pSurveyedAreaFClass = pSurveyedAreaFLayer.FeatureClass
Dim pToDoAreaFClass As IFeatureClass
Set pToDoAreaFClass = pToDoAreaFLayer.FeatureClass
End Sub
Private Sub cmdCancel_Click()
frmSurvey.Hide
End Sub
Private Sub Add(ByVal pFeature As IFeature)
Dim pFeature As IFeature
Set pFeature = New feature
pFeature.FeatureType = esriGeometryPolygon
Dim pClassName As IClassName
Set pClassName = pFeature.Class
pFeature.Class = pSurveyedAreaFClass
End Sub
Private Sub cmdSave_Click()
Dim pFCursor As IFeatureCursor
Set pFCursor = pSurveyedAreaFClass.Search(pFeature, True) '424 Run Time Error ???????????????
Set pFeature = pFCursor.NextFeature
pFeature.Value(1) = pPolygon
pFeature.Value(2) = txtMAPPLAT.Value
pFeature.Value(3) = txtREALMAPCOD.Value
pFeature.Value(4) = txtREALSTNO.Value
pFeature.Value(5) = txtREALSTNAME.Value
pFeature.Value(6) = txtREALAPTNO.Value
pFeature.Value(7) = txtSUBNAME.Value
pFeature.Value(8) = txtNAMNAME.Value
pFeature.Value(9) = txtNAMADDR.Value
pFeature.Value(10) = txtNAMCITY.Value
pFeature.Value(11) = txtNAMST.Value
pFeature.Value(12) = txtNAMZIP.Value
pFeature.Value(13) = txtNAMZIPEXT.Value
pFeature.Value(17) = txtSDDISTRICT.Value
pFeature.Value(19) = txtSURVEY_NUM.Value
pFeature.Value(20) = txtGROUP_NUM.Value
pFeature.Value(21) = txtHIST_NAME.Value
pFeature.Value(22) = txtOTHER_NAME.Value
pFeature.Value(23) = txtSTREET_NUM.Value
pFeature.Value(24) = txtSTREET.Value
pFeature.Value(25) = txtOLD_ADDRES.Value
pFeature.Value(26) = txtCITY_COMM.Value
pFeature.Value(27) = txtNR_DESIG.Value
pFeature.Value(28) = txtLOCAL_DESI.Value
pFeature.Value(29) = txtUSGS_MAPNU.Value
pFeature.Value(30) = txtPVA_MAPNUM.Value
pFeature.Value(31) = txtORIG_USE.Value
pFeature.Value(32) = txtCUR_USE.Value
pFeature.Value(33) = txtDOC.Value
pFeature.Value(34) = txtSTYLE.Value
pFeature.Value(35) = txtDEMOED.Value
pFeature.Value(36) = txtNOTES.Value
pFCursor.UpdateFeature pFeature
Set pFeature = pFCursor.NextFeature
End Sub
And thank you to those who helped me with formatting!
Last edited: