I donīt understand why this error is being flagged when trying to insert a new
entry from a db.
(Why is the flash form so tempremental? I try anything more complex than
select * from artists then it throws an error. What does cfgrid use as the
index?)

<cfquery name="getArtists" datasource="cfcodeexplorer">
select * from artists
</cfquery>

<!--- insert into problem code --->
<cfif isDefined("form.addbtn")>
<CFQUERY name="addArtists" datasource="cfcodeexplorer">
INSERT INTO artists (COMPANY, SECTOR, PHONE, FIRSTNAME, POSITION, ADDRESS,
CITY, STATE, EMAIL, MOBILE, FAX, DTLEAVE)
VALUES ('#Trim(FORM.company)#', '#Trim(FORM.sector)#', '#Trim(FORM.phone)#',
'#Trim(FORM.firstname)#', '#Trim(FORM.position)#', '#Trim(FORM.address)#',
'#Trim(FORM.city)#', '#Trim(FORM.state)#', '#Trim(FORM.email)#',
'#Trim(FORM.mobile)#', '#Trim(FORM.fax)#', '#Trim(FORM.dtleave)#')
</CFQUERY>

</cfif>





<cfif isDefined("form.updatebtn")>
<CFQUERY name="updateArtists" datasource="cfcodeexplorer">
update artists
set COMPANY = '#Trim(FORM.company)#',
SECTOR = '#Trim(FORM.sector)#',
PHONE = '#Trim(FORM.phone)#',
FIRSTNAME = '#Trim(FORM.firstname)#',
POSITION = '#Trim(FORM.position)#', ADDRESS = '#Trim(FORM.address)#',
CITY = '#Trim(FORM.city)#',
STATE = '#Trim(FORM.state)#',
EMAIL = '#Trim(FORM.email)#',
MOBILE= '#Trim(FORM.mobile)#',
FAX= '#Trim(FORM.fax)#', DTLEAVE='#Trim(FORM.dtleave)#'
where ARTISTID = #form.ID#
</CFQUERY>

</cfif>




<cfform format="flash">

<cfgrid name="artistGrid" query="getArtists" rowheaders="FALSE">
<cfgridcolumn name="FIRSTNAME" header="Contact Name">
<cfgridcolumn name="COMPANY" header="Company">
<cfgridcolumn name="PHONE" header="Telephone">
<cfgridcolumn name="SECTOR" display="TRUE">
<cfgridcolumn name="ADDRESS" display="FALSE">
<cfgridcolumn name="CITY" display="FALSE">
<cfgridcolumn name="STATE" display="false">
<cfgridcolumn name="EMPLOYEES" display="false">
<cfgridcolumn name="FAX" display="false">
</cfgrid>


<cfformgroup type="horizontal" label="INSTITUTIONS">

<cfinput type="text" name="COMPANY" label="Company"
bind="{artistGrid.dataProvider[artistGrid.selectedIndex]['COMPANY']}"
onChange="artistGrid.dataProvider.editField(artist Grid.selectedIndex,
'COMPANY', COMPANY.text);">

<cfinput type="TEXT" name="SECTOR" label="Sector"
bind="{artistGrid.dataProvider[artistGrid.selectedIndex]['SECTOR']}"
onChange="artistGrid.dataProvider.editField(artist Grid.selectedIndex,
'SECTOR', COMPANY.text);">

<cfinput type="text" name="PHONE" label="Telephone"
bind="{artistGrid.dataProvider[artistGrid.selectedIndex]['PHONE']}"
onChange="artistGrid.dataProvider.editField(artist Grid.selectedIndex,
'PHONE', COMPANY.text);">

</cfformgroup>


<cfformgroup type="horizontal" label="CONTACTS">

<cfinput type="text" name="FIRSTNAME" label="Name"
bind="{artistGrid.dataProvider[artistGrid.selectedIndex]['FIRSTNAME']}"
onChange="artistGrid.dataProvider.editField(artist Grid.selectedIndex,
'FIRSTNAME', FIRSTNAME.text);">

<cfinput type="text" name="POSITION" label="Position"
bind="{artistGrid.dataProvider[artistGrid.selectedIndex]['POSITION']}"
onChange="artistGrid.dataProvider.editField(artist Grid.selectedIndex,
'POSITION', FIRSTNAME.text);">

</cfformgroup>


<cfformgroup type="horizontal" label="DETAILS">

<cfinput type="text" name="ADDRESS" label="Address"
bind="{artistGrid.dataProvider[artistGrid.selectedIndex]['ADDRESS']}"
onChange="artistGrid.dataProvider.editField(artist Grid.selectedIndex,
'ADDRESS', ADDRESS.text);">

<cfinput type="text" name="CITY" label="City"
bind="{artistGrid.dataProvider[artistGrid.selectedIndex]['CITY']}"
onChange="artistGrid.dataProvider.editField(artist Grid.selectedIndex,
'CITY', ADDRESS.text);">

<cfinput type="text" name="STATE" label="State"
bind="{artistGrid.dataProvider[artistGrid.selectedIndex]['STATE']}"
onChange="artistGrid.dataProvider.editField(artist Grid.selectedIndex,
'STATE', ADDRESS.text);">

</cfformgroup>


<cfformgroup type="horizontal">
<cfinput type="text" name="email" label="Email"
bind="{artistGrid.dataProvider[artistGrid.selectedIndex]['EMAIL']}"
onChange="artistGrid.dataProvider.editField(artist Grid.selectedIndex, 'EMAIL',
email.text);">

<cfinput type="text" name="mobile" label="Mobile"
bind="{artistGrid.dataProvider[artistGrid.selectedIndex]['MOBILE']}"
onChange="artistGrid.dataProvider.editField(artist Grid.selectedIndex,
'MOBILE', mobile.text);">

<cfinput type="text" name="fax" label="Fax"
bind="{artistGrid.dataProvider[artistGrid.selectedIndex]['FAX']}"
onChange="artistGrid.dataProvider.editField(artist Grid.selectedIndex,
'FAX', fax.text);">

<cfinput type="DateField" name="dtLeave" label="ACTION DATE:"
VALUE="#DateFormat(Now(), "mm/dd/yyyy")#" width="150">
</cfformgroup>

<cfformgroup type="horizontal" label="Submit">
<cfinput type="submit" name="updatebtn" value="update" >
<cfinput type="submit" name="addbtn" value="add entity" >
</cfformgroup>
</cfform>