Well,

I would say that you would need to do this on the processing page.

1. Check to see if the value of the equipmentID exists in your DB and if it
does not do an insert of the equipment type and hours.

2. If the value exists then do an update of the equipmentID and hours

3. If I understand correctly they can remove the amount of hours from the
txthours field and that should also remove the equipment type for that
specific equipmentID


<cfquery datasource="yourDsn" name="yourQueryName">
select    equipmentID,hours
from      equipment
where equipmentID = '#equipmentID#
</cfquery>

<CFIF yourQueryName.recordcount EQ 0>
Insert the equipment into the table
<CFELSE>
Update the equipment table
</CFIF>

<CFIF isDefined("form.hours")>
<CFIF (form.hours) EQ "">
Delete the equipment from the table
</CFIF>
</CFIF>


Hope this makes sense



Doug


----- Original Message -----
From: "Angel Stewart" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, December 03, 2001 11:59 AM
Subject: RE: Editing, deleting, and inserting values on form.


> No...they would want to be able to do all things at once.
>
> SO the form would have to look like
>
>
> Equipment Type Hours
> --------------------------------------
> [combo box] [txthours]
> [combo box] [txthours]
> [combo box] [txthours]
> [combo box] [txthours]
> [combo box] [txthours]
> [combo box] [txthours]
>
> [Submit][Reset]
>
> And now from the database..we could have
>
> Equipment Type Hours
> -------------------------------------
> Bulldozer 5
> Crane 6
> [combo box] [txthours]
> [combo box] [txthours]
> [combo box] [txthours]
> [combo box] [txthours]
>
> [Submit][Reset]
>
> And you see the rest can be blank.
>
> And they might want to Delete BullDozer with 5 hours totally..
>
> Or insert say Digger with 6 hours.
>
> While aso changing the 6 hours for Crane to 3 hours because they made a
> mistake.
>
> And then click ONE button and SUBMIT their changes....all from one form
> :-\
> You see?
>
> -Gel
>
>
>
> -----Original Message-----
> From: Douglas Brown [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 03, 2001 3:58 PM
> To: CF-Talk
> Subject: Re: Editing, deleting, and inserting values on form.
>
>
> Why not just put 3 buttons on your page and give them different values.
> I hope I understood your question correctly.
>
> IE:
>
> <input type="button" name="action" value="Add">
> <input type="button" name="action" value="Update">
> <input type="button" name="action" value="Delete">
>
> Then on the processing page, just do
>
> <CFIF isDefined("url.action")>
> <CFIF (url.action) EQ "add">
> Run an insert query
> <CFELSEIF (url.action) EQ "delete">
> Run a delete query
> <CFELSEIF (url.action) EQ "update">
> Run an update query
> </CFIF>
>
>
>
>
> ----- Original Message -----
> From: "Angel Stewart" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Monday, December 03, 2001 11:24 AM
> Subject: Editing, deleting, and inserting values on form.
>
>
> > Ok boys and girls,
> >
> > I've got a little question for you.
> >
> > I have one table, called Equipment..that has EquipID, Equipment
> > Type,and Hours.
> >
> > Now...someone can have equipment entered previously.
> > OR they might want to insert new equipment, or delete existing
> > equipment.
> >
> > I can't use a grid, because the form requires a Combo box that is
> > pulled from a database.
> >
> > What is the logic behind this..some sort of pseudocode..algorithm or
> > something.
> >
> > I just can't get my head around a simple way to do this. Everything
> > I'm thinking of seems overly complicated.
> >
> > -Gel
> >
> >
> >
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to