Error while add new record

  • Thread starter Thread starter mike
  • Start date Start date
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
 
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?
 
Back
Top