I am having problems with addnew 
Author Message
 I am having problems with addnew

I am trying to use an access database 1.1.  I have a form that containes
fields that will be used to be added to the database.  When a user
clicks on a button new the following is executed.  First I call addnew
on the data1.recordset.  Then I fill each field in the database with
data from the form fields.  Finally, I call data1.recordset.update.

The error I receive is runtime.  Basically it says no current record
selected and halts.  The compiler highlights the first line of all these
methods which is addnew and claims no curren records selected.

Anybody understand what is going on?  Can you email me with the sollution.
Thanks,

 A new VB programmer.



Sat, 27 Sep 1997 03:00:00 GMT  
 I am having problems with addnew


Quote:
> I am trying to use an access database 1.1.  I have a form that containes
> fields that will be used to be added to the database.  When a user
> clicks on a button new the following is executed.  First I call addnew
> on the data1.recordset.  Then I fill each field in the database with
> data from the form fields.  Finally, I call data1.recordset.update.

> The error I receive is runtime.  Basically it says no current record
> selected and halts.  The compiler highlights the first line of all these
> methods which is addnew and claims no curren records selected.

Sequence of
data1.recordset.Addnew
data1.Recordset("FieldName") = TextBox.Text
data1.Recordset.Update
is correct.

But have you first fully setup the recordset (ie dynaset), ie
data1.DatabaseName = "your database"
data1.Connect = "???"   is "" (blank) if access
data1.RecordSource = "sql statement" or "tablename" or ...
data1.Refresh

Is that the problem?
Hope this helps.
--
ernest jacobs     at Noel Systems, near Kingston-upon-Thames (UK)



Mon, 29 Sep 1997 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help!!I am having VB homework problem...

2. vb5 i am having problems with lost variables

3. Am having printing problems with Crystal Report.

4. I am having a multi-step problem...

5. I am using the Compare MS Project COM Program and having issues

6. Questions I am Having Trouble With

7. I am having trouble with bitblt

8. Help: I am having trouble with sendkeys

9. I am having trouble

10. I am having probles with this code

11. Regular expression - It should be easy, but I am having a bad time

12. I am having an Identity Crisis

 

 
Powered by phpBB® Forum Software