|
POST
|
All, I'm having real problems with this one and was hoping someone out there could help. I have a form with 3 pages, page 2 has a combobox on it where I have set the listtable to be a dbf file at design time. Page 3 has the ability to append a new entry to the end of the dbf file (This bit of code works fine). I want to be able to see this new entry if I tab back to page 2. I cannot seem to find any method that refreshes the combobox, is it possible? I've tried setting the listtable property of the combobox but it keeps bombing out saying that it's not a property... below is the code that is called by an onclick button event on page 3. Any ideas, I'm using Arcpad 10? Duncan Sub NewSpecies
' Description: Appends a new species to dbf file
'
' Created: 9/9/11
' Get species name
dim b
Set b = ThisEvent.Object
dim p
set p = b.Parent
dim c
set c = p.Controls
dim t
set t = c.Item("ebxNew")
dim s
s = t.Text
If s = "" then
msgbox "You must set the species name first!", vbExclamation, "Invalid species name..."
Exit Sub
End If
' Get file path of APM file then use this to create a path to dBase file
dim fp
fp = MAP.FilePath
dim i
i = instrrev(fp,"\")
fp = left(fp,i) & "SpeciesList.dbf"
' Open dBase file
Dim rs
set rs = APPLICATION.CreateAppObject("RecordSet")
rs.Open fp,2
' Find out what is the last ID and increment by 1
rs.MoveLast
dim id
id = rs.Fields.Item("ID").Value
id = id + 1
' Add new species
rs.AddNew
rs.Fields.Item("ID").Value = id
rs.Fields.Item("Species").Value = s
rs.Update
' Refresh combobox
dim cb
set cb = p.Parent.Pages("PAGE2").Controls.Item("cmbxSpecies")
msgbox cb.Name
set cb.listtable = "SpeciesList.dbf" '<<<<<<<<<<<< This does not work
cb.listtable = "SpeciesList.dbf" '<<<<<<<<<<<<<< nor does this!
Msgbox "Species " & s & " successfully added to list!",vbInformation,"List updated!"
End Sub
... View more
09-09-2011
11:13 AM
|
0
|
2
|
2586
|
|
POST
|
Justin, As I understand it a Feature is nothing more than a row in a table where one of the fields just happens to hold a geometry rather than all fields being non-spatial data. So I don't see why you can't have a row (feature) where all values are set to NULL, this should still be a valid row in your table (featureclass). Anybody out there do correct me if I am wrong? So you dataset is a "simple" shapefile and when you issue a delete is sets everything to NULL but does does not remove the row from the table? Maybe you could post up your code for us to see? Duncan
... View more
09-08-2011
08:19 AM
|
0
|
0
|
1151
|
|
POST
|
Mele, I've never used it but have a go at using the Interface IDatasetEdit? Duncan
... View more
09-08-2011
08:11 AM
|
0
|
0
|
669
|
|
POST
|
You could try to run the MXD through MXD Doctor? I suggest you back up the file before you do that just in case it blitzes it. It's a tool under the Desktop Tools group if you are using version 10. Duncan
... View more
09-08-2011
07:24 AM
|
0
|
0
|
941
|
|
POST
|
Justin, I'm surprised the pFeature.Delete did not work which suggests to me the source of your problem is something else, what format is your data store as? If it's ArcSDE then maybe some weird locking is going on? I would try you code on a small sample of say a shapefile? Duncan
... View more
09-08-2011
07:14 AM
|
0
|
0
|
1151
|
|
POST
|
All, Just want to run this past the ArcObject Gurus\ESRI to make sure I'm not doing something dumb. I have created an instance of a GXDialog and set the ObjectFilter to Personal GeoDatabase. My code is below: Public Sub test()
Dim pGXDialog As IGxDialog
Set pGXDialog = New GxDialog
' Set properties
Dim pGXObjectFilter As IGxObjectFilter
Set pGXObjectFilter = New GxFilterPersonalGeodatabases
Set pGXDialog.ObjectFilter = pGXObjectFilter
pGXDialog.Title = "Locate Access Database"
pGXDialog.AllowMultiSelect = False
pGXDialog.ButtonCaption = "Open"
' Open dialog
Dim pEnumGXObject As IEnumGxObject
pGXDialog.DoModalOpen 0, pEnumGXObject
' Get Object
Dim pGXObject As IGxObject
Set pGXObject = pEnumGXObject.Next
End Sub The resulting Dialog has a file type of File and Personal GeoDatabases which means a user can potentially select a File GeoDatabase which would be a problem. See image below. Is this a bug in ArcObjects? Duncan
... View more
09-02-2011
07:03 AM
|
0
|
1
|
1034
|