On 07/14/2010 06:13 PM, Paul McNett wrote: > On 7/14/10 6:01 PM, Jeff Johnson wrote: > >> Paul: I am having trouble with SQLite data, dTextBox.Value and doing >> math on the values. I am getting all sorts of data type mismatches. I >> need to step back and see what I am doing before I can ask intelligent >> questions. >> > Ok, remember that calculations likely belong at the biz layer rather than the > ui > layer, so biz.VirtualFields are your friend. You'd do, e.g., in your biz > class: > > self.VirtualFields["calc_total_amount"] = self.vfTotalAmount > self.VirtualFields["calc_total_amount_display"] = self.vfTotalAmount > > def vfTotalAmount(self): > return self.Record["qty"] * self.Record["price"] > > def vfTotalAmountDisplay(self): > return "$ %.2f" % self.vfTotalAmount() > > ...and then at the UI layer, you'd set the DataField to 'calc_total_amount' > and > probably make the textbox ReadOnly. If needed, you'd call txt.update() to > force the > calculation to happen immediately. > > > >> As far as everything else goes, the UI and Reports; I am really getting >> up to speed. I am doing some very nice looking reports! >> > Awesome to hear! > > Paul > > >
Thank you Paul. That is very helpful! -- Jeff --------------- Jeff Johnson [email protected] (623) 582-0323 www.san-dc.com _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
