AddNew method does not work 
Author Message
 AddNew method does not work

I have the following code in the click event of a save button to add a new
record to a table

Dim dbs as database, rst as recordset
set dbs = opendatabase("c:\....\dbMembers.mdb")
set rst = dbs.openrecordset("MEMBERS")
debug. print rst.updatable       'returns true!!!
rst.Addnew
rst!MemberId = txtMemberId
rst!MembFunction = txtMembFunction
rst!MainFunction = chkMainFunction
rst.Update
rst.close
set dbs = nothing

I get no errors when i click the button, but the record is not added to the
table.
When i step through the code I can see that the textbox values are passed to
the table fields but it seems like the update method has no effect.

Has anyone any suggestions on this problem?

Thanks a lot

Jef



Sun, 07 Jul 2002 03:00:00 GMT  
 AddNew method does not work
Sorry folks,

Opened the wrong database file. Everything works fine. Data was just added
to the wrong database which happened to contain the same table.

Jef


Quote:
> I have the following code in the click event of a save button to add a new
> record to a table

> Dim dbs as database, rst as recordset
> set dbs = opendatabase("c:\....\dbMembers.mdb")
> set rst = dbs.openrecordset("MEMBERS")
> debug. print rst.updatable       'returns true!!!
> rst.Addnew
> rst!MemberId = txtMemberId
> rst!MembFunction = txtMembFunction
> rst!MainFunction = chkMainFunction
> rst.Update
> rst.close
> set dbs = nothing

> I get no errors when i click the button, but the record is not added to
the
> table.
> When i step through the code I can see that the textbox values are passed
to
> the table fields but it seems like the update method has no effect.

> Has anyone any suggestions on this problem?

> Thanks a lot

> Jef



Sun, 07 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. .addnew method ADO does not work pls help

2. AddNew Method not working for me anymore.

3. AddNew/REquery method of ADO Recordset not Working?

4. Addnew and update method in ADOCE not working ?

5. What is AddNew method doing

6. not to auto update while doing addnew

7. Cannot make AddNew method work properly.

8. AddNew method doesn't work right!!

9. Cannot make AddNew method work properly.

10. AddNew method not adding.

11. AddNew method not adding.

12. AddNew - Access provider does not support this method?

 

 
Powered by phpBB® Forum Software