General information
Category:
Forms & Form designer
>I have created several tables, which are linked by a key value in the master table. I then used the Form Wizard to create a form for the master table. I subsequently added grids for the child tables, using the grid builders. The form executes correctly. However, when I click the Add button, a window pops up with three options: add to parent, Add to child, add to both. I would really like to avoid this and just add to parent, then put code in the grid doubleclick event to add to the child tables. How can I do this? I have tried selecting the correct tables, then append blank, then thisform.refresh, but this doesn't work.
In WIZSTYLE.VCX you'll find the classes gridaddrec and gridaddform. Make copies of these in your own class library, rename them with the RENAME CLASS command, then rip out the stuff you don't want. In your case, you may want to rip out the reference to "gridaddform" alltogether. Your own version of gridaddrec can just INSERT or APPEND a record in your parent, with your key value. Then it might call a method called "setdefaults" which would be blank in the class. Each instance of the class could contain code to fill in default values for fields on the form.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only