![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 5 of 5 total |
![]() |
Tue, Feb 2 2010 10:22 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | I have a table (Companies) which is used in a base form (CompaniesForm) and a number of inherited forms. In one of them I have introduced a calculated field to show in a checkbox in a TDBAdvGrid when a company is included in a specific project. A stringlist is also maintained of the company (CompanyID) codes. My problem comes when ticking or unticking the checkbox in the column. It takes around .6 - .7 secs I traced it down to the call to Companies.Refresh. I tried changing that to Companies.Edit;Companies.Cancel; and it works but a) isn't suitable for multi user use and b) is just as slow
I need something that will trigger the oncalcfields event for a specific row in the table, or a totally different approach. I'm experimenting with the enhanced CREATE TABLE AS so any other suggestions? procedure Tcp_CompaniesForm.CompaniesCalcFields(DataSet: TDataSet); var Junk: integer; begin inherited; Companies_xInProject.AsBoolean := CompanyIP.Find(Companies_ID.AsString, Junk); end; Roy Lambert |
Tue, Feb 2 2010 7:19 PM | Permanent Link |
Richard Harding | Hi Roy,
>>I have a table (Companies) which is used in a base form (CompaniesForm) and a number of inherited forms. In one of them I have introduced a calculated field to show in a checkbox in a TDBAdvGrid when a company is included in a specific project. A stringlist is also maintained of the company (CompanyID) codes. What do your DB tables look like? Is it anything at all like this? Companies (ID, . . . . . . ) Projects(ID, . . . . .) ProjectCompanies(ID, ProjectID, CompanyID) What information is the form showing? Is it a form with project information and the user selects the associated companies for that project from a list of companies? Have I got that even remotely close? Richard Harding |
Wed, Feb 3 2010 2:19 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Richard
>What do your DB tables look like? Is it anything at all like this? > >Companies (ID, . . . . . . ) >Projects(ID, . . . . .) >ProjectCompanies(ID, ProjectID, CompanyID) > >What information is the form showing? Is it a form with project information and the user >selects the associated companies for that project from a list of companies? Have I got >that even remotely close? Pretty much, but naturally, its more complex ![]() Roy Lambert |
Wed, Feb 3 2010 6:58 PM | Permanent Link |
Richard Harding | Roy,
Given the tables look something like this: Companies (ID, . . . . . . ) Projects(ID, . . . . .) ProjectCompanies(ID, ProjectID, CompanyID) and that the Project form shows project information and the user selects the associated companies for that project from a list of companies. Not sure if I understand - - - however, is it a matter of having a panel with project details and a grid that lists all the associated companies? I do either one of the following. 1. Choose a company from a drop down list for each row of the grid. 2. Choose a company from a dialog box for each row of the grid. 3. Use a checked listbox (or similar) in a dialog box to select the required companies for the project. This updates the ProjectCompanies when the dialog is closed. For my project database system, I also have a Role table which may contain entries such as Surveyor, Accountant, Solicitor, Pest Inspector, Town Planner, Local Government and so on. A contact (which may be a company) may be assigned any number of roles. (ContactRoles table). So users can assign the roles (for example Town Planner) to a project and then select the Town Planner from the Town Planner subset of contacts. Richard Harding |
Thu, Feb 4 2010 4:11 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Richard
Near, but so far away ![]() The only way I've found to get the calculated field recalculated is to either refresh the table or edit/cancel the record both of which operations take to much time. What I'm thinking of doing is having a memory table with the company ID and a boolean field. This can then be tied to the company table in a master-detail arrangement and the checkbox directly edited thus bypassing the need for calcfields. Roy Lambert |
This web page was last updated on Wednesday, July 2, 2025 at 06:46 PM | Privacy Policy![]() © 2025 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |