Share via

Update active record through vba

Anonymous
2011-12-12T19:05:50+00:00

I have a form which the user will use to navigate through the db records.  I also have a command bar which has certain administrative buttons.  One of which need to change the status of the active record.

I did something along the lines of :

sSQL = "UPDATE tbl_ComInt" & _

                   " SET tbl_ComInt.projFin = True" & _

                   " WHERE (tbl_ComInt.projId=" & projId & ");"

            db.Execute sSQL, dbFailOnError

but this results in a 3218 record lock error.  I'm assuming because the user is actively on the record, so it is locked for me to make my update.

How would others suggest I make this work?

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2011-12-12T22:17:56+00:00

In that case, you don't need an update query. You can set the value directly:

Me.projFin = True

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2011-12-12T22:06:03+00:00

    It is bound to the same table: tbl_ComInt, hence this is why I suspect I am experiencing this problem.

    Was this answer helpful?

    0 comments No comments
  2. HansV 462.6K Reputation points
    2011-12-12T20:34:24+00:00

    Is your form bound to a table or query, or is it unbound (i.e. no Record Source) and is everything done through VBA?

    Was this answer helpful?

    0 comments No comments