HELP! simple question need simple answer

HELP! simple question need simple answer

Post by Untitled_ » Fri, 28 Nov 1997 04:00:00



hello...

I am really bad at databases and VB5...
All I want to do is to add or remove a record from the current recordset.

The code "Data1.Recordset.AddNew" adds an empty record to the recordset...
but I'm not sure how to change what record is to be entered!

Please help. Thanks!

 
 
 

HELP! simple question need simple answer

Post by Tom Childe » Fri, 28 Nov 1997 04:00:00




Quote:>hello...

>I am really bad at databases and VB5...
>All I want to do is to add or remove a record from the current recordset.

>The code "Data1.Recordset.AddNew" adds an empty record to the recordset...
>but I'm not sure how to change what record is to be entered!

>Please help. Thanks!

With Data1.Recordset
        .AddNew
        !Field1 = "something"
        !Field2 = 25
        .Update
End With

+-----------------------------------------------------------------+
| Tom Childers - Arlington, Texas                                 |

+-----------------------------------------------------------------+

 
 
 

HELP! simple question need simple answer

Post by Alesh Musta » Fri, 28 Nov 1997 04:00:00


Look in help under update, edit. All considering recordset.

---
Alesh Mustar
VBBBN Vice-President

http://www.vbbbn.com

 
 
 

HELP! simple question need simple answer

Post by Untitled_ » Fri, 28 Nov 1997 04:00:00


Thanks a lot
It's working great

Untitled_1




>>hello...

>>I am really bad at databases and VB5...
>>All I want to do is to add or remove a record from the current recordset.

>>The code "Data1.Recordset.AddNew" adds an empty record to the recordset...
>>but I'm not sure how to change what record is to be entered!

>>Please help. Thanks!

>With Data1.Recordset
> .AddNew
> !Field1 = "something"
> !Field2 = 25
> .Update
>End With

>+-----------------------------------------------------------------+
>| Tom Childers - Arlington, Texas                                 |

>+-----------------------------------------------------------------+

 
 
 

HELP! simple question need simple answer

Post by Axel Pincker » Tue, 09 Dec 1997 04:00:00


Hi!
If you want add a new record, move to the last record first, so it will
be appended to your recordset.

Data1.Recordset.MoveLast
Data1.Recordset.AddNew
Data1.Recordset.Update
Data1.Recordset.MoveLast

First you move to the last record, then you add a new one, then you save
it, and then you move to it again.

If you want to delete a record, then first move to the one you want to
delete, then use:

Data1.Recordset.Delete

 
 
 

HELP! simple question need simple answer

Post by Jim Fergus » Wed, 10 Dec 1997 04:00:00


Quote:>If you want add a new record, move to the last record first, so it will
>be appended to your recordset.

????

You don't have to .movelast in order to append a record to the
recordset. Records are always added to the end of dynaset-type
recordsets. The rows won't be gathered back into their proper location
until you requery the recordset.

-- Jim Ferguson, FMS
   http://www.fmsinc.com