Hi I am building a form in AP 8 where I have multiple combo boxes hosting .dbf drop-down lists, all set to write to the same attribue field. The visibility of each combo box is determined by a series of radio buttons so that only one combo box at any time will be able to return a value. However I can't get the attribute table to populate. Do I have to de-activate the invisible combo boxes or set the visible one to active or something?
Hi Klas my problem is not getting the list boxes to populate but getting the shapefile attribute table to populate. Because there are several combo boxes, all linking to one attribute field but only one combo box ever has a value at any given time, I suspect maybe the blank combo boxes are returning the final value to the attriute table. I have set all the non-visible combo boxes to Enabled=fasle but I still cant return a value from the enabled combo box.
Hi Stephen, I created a similar form sometime back, where the subtype of a feature class was selected on one page, which changed the available options for the comboboxes on other pages and had multiple comboboxes tied to one attribute. The only work around I ever found for the same problem (not saving anything) was to populate the combo boxes' options with an SQL query (it was an AXF) and not have any of the comboboxes tied to the attribute itself.
You have to then add code to save the attribute manually during the form "unload" event. Something like: Determine which combobox you want to save based on blankness Get a reference to the fields field.value = combobox.value
Nothing too fancy, but still a hassle when it seems like this (if the user has multiple comboboxes tied to the same attribute, use the value of the populated one) should be part of ArcPad's logic.
Thanks Eric In the end I made a work around by removing the radio buttons and instead have interdependant combo boxes where the second combo box populates with a list dependant on the selection made in the first combo box. Works out almost as well in this case
So what you have is a combobox with say...trees,shrubs,grasses and when select 'trees, the second combobox only loads up with tree species??
Precisely. And before you ask the code is below. In this case item chosen from a dbf list linked to "cmbActn" will populate the combobox "cmbWrkMthd"
sub SelectList 'sub to select specific entires from a dbf file for inclusion in dropdown menu on form, based on previous choice
dim pLayer, pAction, pWorkMethod, filepath, GetPath set pLayer = Application.map.selectionLayer.Forms("EDITFORM") pAction = pLayer.Pages("PAGE3").Controls("cmbActn").value set pWorkMethod=pLayer.Pages("PAGE3").Controls("cmbWrkMthd") if pWorkMethod.ListCount > 0 then pWorkMethod.Clear end if GetPath = Left(application.map.selectionlayer.FilePath, InStrRev(application.map.selectionlayer.FilePath, "\"))
if pAction <> "" then filePath = GetPath & "WorkMethod.dbf" pWorkMethod.AddItemsFromTable filePath, "Method", "Method", "[ACTION] = """& pAction & """"
end sub 'SelectList
and the dbf for the second combobox (in this case WorkMethod.dbf) must look like this: ACTION METHODTXT Weed Control Spray - Chemical Weed Control Spray - Rust Weed Control Hand Removal Weed Control Other (Please Type) Fencing Standard Fence Fencing Other (Please Type) Revegetation Reveg with Indigenous Vegetation Revegetation Other Reveg (Plse Type)