![]() The form is then opened and it loads all the data from the TMessageDetails record into the respective controls. Each time a form is opened a spare 'slot' in this array is found, a new form created, the TMessageDetails record initialized (or data loaded into it from the DB) and a pointer to this record is given to the form. I then have an array of TFormDetails with length 6. To manage these forms, I have another record (TFormDetails) with elements such as FormName (each form is given a unique name when created), an instance of TMessageDetails, FormTag and some other bits. The only restriction is that two forms in EDIT mode cannot be editing the same message - the main form prevents this. Unlike perhaps other applications, I am allowing the user to have up to 6 instances of the message form open at any one time - and each one can be in either NEW or EDIT mode. I have then defined a fifth record structure with four elements - each element being one of the previous four defined record structures - this is called TMessageDetails. The message form captures four distinct groups of information, so for each one I have defined a specific record structure in a separate unit (lets call them Group1, Group2, Group3 and Group4) each containing different numbers/types of elements. In the case of NEW a blank dataset/record is loaded - read on. Edit message by clicking on respective line in gridīoth of these actions cause an instance of the form to be created and initialized, and in the case of EDIT, the fields are then populated with the respective data from the database.Create new/blank message by clicking a button.There are two actions the user can perform: There are lots of little helpers and automation's that run depending on the user input, but my question is related to the underlying data capture and storage. ![]() The main form contains a grid showing the messages already in the DB, and I have a 'message form' which is a VCL form containing edit, combo and checkboxes for all the respective fields the operator must log, some are mandatory, some are optional. I am building an application that allows a telephone operator to take messages, write them into a form and save them to a DB. My question is one of best practice and what is the best way to implement this, but to answer you will need to know what I am trying to achieve. Apologies for the long winded question - I am experienced with the basics but this is first time working with datasets and databases (previously applications involved records, arrays and text files).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |