How to increment a field in a table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the code for incrementing an integer field in a table by pushing a
button on a form? I'm drawing a blank. thanks in advance
 
Hi,
i think easiest way is to use an update query:

currentdb.execute "Update MyTable Set MyField=MyField+1 Where ID=" & me.ID,
dbfailonerror
 

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

Back
Top