Error while add new record

M

mike

Hi All,

I'm trying to insert a number to a primary field in a
table and I'm having errors.

The code is:

Dim db AS DAO.Database
Dim rstApp AS DAO.Recordset
Dim smid AS Long

smid = 5

Set rstApp = db.OpenRecordset("Application")
With rstCompApp
.AddNew
!ComputerID = smid
.Update // i'm getting an error here, where Index
can not contin a null value. But I
assign the value to it.
End With

Thanks,

mike
 
M

Mike M.T.

Taking a better look at your code I see that rstApp is "Application", at
least that's what you're opening. Now who's rstCompApp?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top