Hello,

Got a problem with my program. This is the code for adding data into the database (Access 97):

Private Sub cmdAdd_Click()
'set button states
cmdSave.Enabled = True
cmdAdd.Enabled = False
cmdEdit.Enabled = False
'Unlock textboxes so changes can be made
Call UnlockTextBoxes
'Clear all data from textboxes
Call ClearTextBoxes
'Go into Add New Records mode
Data1.Recordset.AddNew
End Sub

Whenever I click on it, an error appears saying: "This action was cancelled by an associated object", with the Data1.Recordset.AddNew line highlighted. What's wrong?

BTW, this is how the table in the database linked to the program looks like:

SHRUB_ID (AutoNumber)
SHRUB_DESCR (Text, 25 char)
REQ_TEMP (Integer)
GREENHOUSE_NBR (Integer)

Is the AutoNumber field somehow bound to the program and causing the error when .AddNew is run?

Thanks!