1

I'm creating a Voting System. so it's like this every time A Button1 is pressed + 1 or it will increase the vote in the Access database. I can't find anything in Google.

trx = "update [Table1] SET [Vote] = Vote + 1, (WHERE ID = 1)"
1
  • 1
    What's the question? Where do you get stuck? Commented Jan 22, 2015 at 13:55

2 Answers 2

4

Don't include a comma before the WHERE clause. Also you don't need to put the WHERE clause inside parentheses.

Test this as a new query in the Access query designer.

update [Table1] SET [Vote] = Vote + 1 WHERE ID = 1

Fine tune as needed. And once you have it working in the query designer, adapt your VBA code to use that working statement.

Sign up to request clarification or add additional context in comments.

Comments

1

Remove comma before Where and brackets around where clause

trx = "update [Table1] SET [Vote] = Vote + 1 WHERE ID = 1"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.