Ok...most of my trouble was resolved with John's suggestion. so now I need
to now how to right both the Choices and the Keys from my dropdownlist to
two fields in the database:

Keys (CityID from the Cities table) are already correctly being written to
the CityID field of the Companies table.
How can I write the Choices (CityName from the Cities table) to the City
field of the Companies table.

In the CitiesBizObj:

    def getCities(self):
        crs = self.getTempCursor()
        crs.execute("select CityID, CityName from dbo.Cities order by
CityName")
        ds = crs.getDataSet()
        names = [rec["CityName"] for rec in ds]
        keys = [rec["CityID"] for rec in ds]
        names.insert(0, "-Select A City-")
        keys.insert(0, 0)
        return (names, keys)

In the frmCompanies-code.py file:

## *!* ## Dabo Code ID: dDropdownList-dPanel-222
def afterInit(self):
    bizCities = self.Form.getBizobj("dbo.Cities")
    bizCities.requery()
    names, pks = bizCities.getCities()
    self.Choices = names
    self.Keys = pks
    self.ValueMode = "Key"

Thanks
Carey


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/CAMGTPFE6tuHEKh=u5a8wqaod4owg2mdf6tvhauczeb1qjy0...@mail.gmail.com

Reply via email to