Append qry also updating

Chose.cz

Registered User.
Local time
Today, 19:42
Joined
Aug 8, 2006
Messages
12
Hello,

I have a button on my form that inserts a record into a table, filled with the contents of textboxes on that form. It works, but it is also does something strange - more oten than not it also updates one of the existing records with the data from the form (it only updates one of the fields- usually record no. 2, but sometimes 1 or 3 (out of 340).
I've tried inserting via both RunSQL and recordset with same result, so I guess it's not the matter of bad syntax. Access doesn't show any update warning.

Did this happen to anyone else?
 
As I said, I have experimented with both query and recodrset solution with same result, but here's the code behind the button anyway:

Dim dbs As DAO.Database
Dim rst As DAO.Recordset

Set dbs = CurrentDb

Set rst = dbs.OpenRecordset("SetQuestions")

AddRecord: rst.AddNew
rst![Domain Name] = Domain
rst![Question] = Question
rst![BoundTo] = Forms!RiskAssesment.[ID]
rst![Project relevance] = [Project relevance]
rst![System relevance] = [System relevance]
rst![EC relevance] = [EC relevance]
rst.Update
 
Solved

So, I finally found it - it had nothing to do with the button, it was the "Control Source" property set on the form textboxes - dumbest mistake ever, I'm gonna go nail my head to a subway track.
 

Users who are viewing this thread

Back
Top Bottom