Thanks Peter, that will help a lot understanding the syntax, etc. John Weller 01380 723235 07976 393631
> -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Peter Hart > Sent: 22 April 2009 21:36 > To: [email protected] > Subject: RE: Adding Objects to a Form > > Hi John > > ThisForm.AddObject(cmbField,"ComboBox") will add a combo to a > form (I would place code in init of form) > ThisForm.AddObject(cFieldsLabel,"Label") will add a label The > add the properties with ThisForm.cmbField.Top = 20, > ThisForm.cmbField.Left = 100 etc > > However in my purchase orders form I populate the form with > checkbox's for the people oho may need to be emailed. I set > up the maximum required placed were I wanted them to show and > then made them invisible. > > I then used the code below to populate them as required. > > Local lcDeleted,lnCheckBoxNo,lcCheckBoxName,lcProperty,lcSuffix > > lnCheckBoxNo = 1 > > lcDeleted = Set("deleted") > > Select EmailDetails && Email address table Set Deleted On > lcSuffix = Alltrim(Thisform.txtSuffix.Value) && Employee > initials (Employee creating Purchase Order) > > If Atc(" ",lcSuffix) > 0 > lcSuffix = Left(lcSuffix,Atc(" ",lcSuffix) -1) Endif > > Select EmailDetails > Scan For Alltrim(EmailDetails.POPrefix) = lcSuffix && PO > Prefix is employees who this employee emails > > lcCheckBoxName = "ThisForm.Check" + > Transform(lnCheckBoxNo) + "." && Check box's have been left > as Check1 etc > lcProperty = lcCheckBoxName + "Caption" > &lcProperty = Alltrim(EmailDetails.CopyTo) && Employees > initials (Copy this PO to.) > lcProperty = lcCheckBoxName + "Visible" > &lcProperty = .T. > lcProperty = lcCheckBoxName + "BackStyle" > &lcProperty = 0 > lcProperty = lcCheckBoxName + "Value" > > If EmailDetails.lEmail > &lcProperty = 1 > Else > &lcProperty = 0 > Endif > > lnCheckBoxNo = lnCheckBoxNo + 1 > > Endscan > > Thisform.lnnoofemails = lnCheckBoxNo -1 && for use elsewhere > for scanning who needs to be emailed. > > Set Deleted &lcDeleted > _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/699a5479d7f647ada0413c49164ce...@wessex1 ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

