David,

Thanks for the interest, but I suspect the solution you're heading towards
would revolve around populating records in one table with multi-selects
from  another table. What I'm needing (or wanting) to do is enter multiple
records in the child table where the input is text that the user types in.
In case I'm wrong, the answer to your question is that the "nbrOrder" and
"bullet" fields in the child table are simply text fields -- bullet is for
the text to be entered, and nbrOrder is for the order the user wishes to
establish for the resulting UL elements on the display template.

Thanks,
--John



                                                                                       
             
                    David                                                              
             
                    Shadovitz            To:     CF-Talk <[EMAIL PROTECTED]>   
             
                    <dshadovi@jun        cc:                                           
             
                    o.com>               Subject:     Re: Multi-table inserts & 
updates             
                                                                                       
             
                    10/26/2000                                                         
             
                    01:04 AM                                                           
             
                    Please                                                             
             
                    respond to                                                         
             
                    cf-talk                                                            
             
                                                                                       
             
                                                                                       
             




John,

I see that bullets is one of the child tables, and that its bid field
provides the relationship to the parent table.  Where do nbrOrder and
bullet come from?  Which field comes from the child table's <input> field
on the entry template?

I ask in order to see if my method would work for you.  I have an entry
template with a form containing several text input elements for parent
table values, and a multiple-select element whose options each represent
an entry in a child table.  Upon submit I put the option values into a
hidden element as a list.  On the form's action page I insert a record
into the parent table and then I loop over the list, doing an insert into
the child table for each list item.

It ain't easy to explain, but your answers to my questions at the top may
make it more clear to us.

-David

On Wed, 25 Oct 2000 10:59:04 -0500 John Allred <[EMAIL PROTECTED]>
writes:
> I need some advice on how to set up a form that will either insert or
> update data to multiple tables in the same database. I have a parent
> and
> two child tables in an Access database, and there is a one-to-many
> relationship established between the parent and each of the
> children. I'd
> like to keep this so I can cascade deletes, but if need be, I can
> work
> around it.
>
> At present, the <FORM> on my entry template includes only one
> <INPUT> field
> for one of the child tables. Using the following code in my action
> template, I can use one form to insert a record in both tables.
>
> <CFINSERT
>      dataSource="annc"
>      tableName="vendor"
>      formfields="vendor, imageName"
>      >
>
> <cfquery datasource="annc" name="getID">
> select max(vid) as bid
> from vendor
> </cfquery>
>
> <cfquery datasource="annc">
> insert into bullets(bid, nbrOrder, bullet)
> values ('#getID.bid#', '#nbrOrder#', '#bullet#')
> </cfquery>
>
> Ideally, I'd like to be able to enter any number of child records at
> the
> same time I create the parent record, using the same form. I'm
> thinking it
> might be possible to switch to <CFFORM> and include a <CFGRID> for
> the
> child tables.
>
> Has anyone done something like this? And could you offer advice on
> this or
> another approach. So far as I can find, CFWACK only has two
> paragraphs on
> entering data in multiple tables (p. 271 in the 2nd ed.).
>
> Thanks for any help.
> --John Allred
________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.
------------------------------------------------------------------------------------------------

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to
[EMAIL PROTECTED]




------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to