Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating two tables from a form 2

Status
Not open for further replies.

PTmon

IS-IT--Management
Mar 8, 2001
284
US
I'm new to this so be patient :)
I have a table for Customers, with 3 fields: record Id, Company name ( a one-word name for passing a varaible IE Acme) and Description (for full company name IE Acme Widgets, Co.)

I have another table with clients listed. It contains Firstname, lastname, email address, username, password, description and company.

I have a cfform to add a client to the client table. The form is filled out with text boxes with exception of the company, which a pull-down box populated from the company table. I need to be able to add the description to thier record as well, I have no problems getting the company updated, but not sure on how to have the company matched against the company table to pull the description of the company and add it in as well. Any help would be greatfully appreciated.
Thanks,
PT
 
If you aren't using <cfinsert>, you can query the company table to find the description and then do your insert using the returned value. Another approach would be to set the value attributes to the company description and display the company name like this.

<option value=&quot;Acme Company supplies widgets&quot;>ACME

This isn't the best solution IMO but should work with <cfinsert>. Just remember to espcape any double quotes when writing out the company description if you use it.

Hope this helps,
GJ
 
In the client table you could replace the company and description fields with an CompanyID field containing the record ID of the Customer Record.

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top