(asked in the Newsgroups) :
Well, I thought I had finally figured out how to get my form to work the way I want it to. Meaning, on my form I want the following phone types to display as defaults:
All my *hidden* fields have a back color of hot pink. I started doing this a long time ago so I could keep track of which fields I have hidden when in Design View. (Fortunately, no one has ever asked me to design a form in hot pink or I would have to change the backcolor of my *hidden* fields!)
To do this you would need a combination of a main form\subform (however, no one will see it), a table to hold Phone Types and Allen Browne’s code.
Allen Browne’s code copies existing child records with its main record to a new record. You want to copy new child records with or without main record. To make the code *work for you* your child records are going to need a trigger, hence the need for a Phone Types table.
In the example below the subform has been set-up to show five rows, the same as the default Phone Types. To adjust the Phone Type defaults check/uncheck the Add check box. To display the default Phone Types in a specific order simply adjust the number in the Order column. The Sort Order column controls the order in which they display in the Combo Box on the Client Profile Form.
Click here to download a sample file displaying the technique.
Auto-Add new child records when adding a new record on Main form...
The add check box is your trigger...
Why is that pink? Can I remove it?
The difficult I do immediately, the impossible takes a little bit longer.
Forms
It doesn’t work. If I decide to add a new Client/Company I want it to automatically display the default phone types (which I would also like to be able to select the defaults to display) AND I don’t like subforms.