Query to add a new record to MS Acess.

Posted on 2011-04-19
Medium Priority
Last Modified: 2012-05-11
Hi Team,

Can you please provide me a query for my VBA coding.  I am looking at adding new lines into a database using a vba query.
Question by:Sandesh555
  • 2
LVL 26

Assisted Solution

jerryb30 earned 668 total points
ID: 35430037
You'll have to be a little clearer.
Adding a record into a recordset is pretty easy.
Suppose you have a table with an autonumber field and an a date field, and you want to add today's date

dim rs as dao recordset
set rs = currentdb.openrecordset("YourTable")
rs!Yourdatefield = Date()
'(The autonumber field will be automatically updated)
LVL 40

Assisted Solution

by:Vadim Rapp
Vadim Rapp earned 1332 total points
ID: 35430151
The best practice in Access is in in letting Access handle all data manipulation, rather than program it in VBA.

Author Comment

ID: 35430718
Hi vadimrapp1

I am working on creating a database base which will taken data from MS Outlook (from the given folder) and on the other end this data has to be updated by multiple users as completed.

Upon completion, it has to be marked as completed in access with the data and time and with the username who marked it completed (username could be taken from the system).

What is the best solution you propose.
LVL 40

Accepted Solution

Vadim Rapp earned 1332 total points
ID: 35432721
I see, it's not native data for Access.

I would try this first:
How to retrieve Exchange and Outlook data with the Jet 4.0 OLE DB provider in Access 2000

Username would have to be put by the code, using Environ("username")

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question