Trying to add new record to Access database 
Author Message
 Trying to add new record to Access database

I get the runtime error: "3426, This action  has been canceled by an
associated object" when I try to do the following:

Private Sub cmdNewCustomer_Click()

datData.Recordset.AddNew
datData.Recordset(0) = txtCustID.Text
datData.Recordset(1) = txtComp.Text
datData.Recordset(4) = txtPhone.Text
Call Check(txtCustID, txtComp, txtPhone)
If mbolCheckeroo = True Then
datData.Recordset.Update
End If



Sat, 26 Aug 2000 03:00:00 GMT  
 Trying to add new record to Access database

maybe the datData.Recordset(0) should be written as
datData.Recordset.Field(0)=txtCustID.Text and so on.

Regards
Ron

Quote:

> I get the runtime error: "3426, This action  has been canceled by an
> associated object" when I try to do the following:

> Private Sub cmdNewCustomer_Click()

> datData.Recordset.AddNew
> datData.Recordset(0) = txtCustID.Text
> datData.Recordset(1) = txtComp.Text
> datData.Recordset(4) = txtPhone.Text
> Call Check(txtCustID, txtComp, txtPhone)
> If mbolCheckeroo = True Then
> datData.Recordset.Update
> End If



Sun, 27 Aug 2000 03:00:00 GMT  
 Trying to add new record to Access database

Maybe datData.Recordset(3) is a field define as not null?
Then you must fill this field too!

--
   Tony Liccardo
  Microsoft Certified Professional
    #8{)}

Quote:
>I get the runtime error: "3426, This action  has been canceled by an
>associated object" when I try to do the following:

>Private Sub cmdNewCustomer_Click()

>datData.Recordset.AddNew
>datData.Recordset(0) = txtCustID.Text
>datData.Recordset(1) = txtComp.Text
>datData.Recordset(4) = txtPhone.Text
>Call Check(txtCustID, txtComp, txtPhone)
>If mbolCheckeroo = True Then
>datData.Recordset.Update
>End If



Fri, 01 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Weird ASP error when trying to add a new record to a MS Access database

2. Can't add new record to Access database with DataControl

3. add new record to MS ACCESS database

4. Can't add new record to Access database with data control

5. add a new record into my Access database

6. How to add new records in a new database

7. adding new records & new record

8. trying to write a new record to an Access 97 table

9. Problem adding new record to SQL database recordset

10. adding records to new database - cancelled by associated object

11. Remote Data Control--Problems with Adding new Record to SQL Server 6.0 Database

12. New User: Adding records to a database

 

 
Powered by phpBB® Forum Software