Error after VBA Insert - Microsoft access cannot find a record.

S

Stormrider

I have an insert function on a form in VBA (see below).

When I try to insert a record the record is displayed on form but the
following error message pops up:

The Microsoft Office Access Database Engine cannot find a record in the
table...

When I ok and quit Access I get the usual you cannot save the record at this
time. If I close and reenter the form the record IS saved and there.

My code is below, any ideas?

Thanks!

Private Sub Greenhouse_AfterUpdate()

Dim mSQLCmd As String
mSQLCmd = "INSERT INTO Production_Run_Greenhouses VALUES ('" & Me.Text10 &
"','" & Me.Greenhouse & "'," & "1" & ")"
CurrentDb.Execute mSQLCmd

End Sub
 
S

Stormrider

I should add that the form is based on a query and the INSERT, updates two
tables which combined form the query. Only information from one table is not
found the other is but both tables are updated.
 

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