Solved

Editing Some Records in Access 2007 (.accdb) file through VB.NET

Posted on 2010-11-15
4
524 Views
Last Modified: 2014-06-16
i want to edit some records in table of access 2007 file through vb.net

0
Comment
Question by:habib181084
4 Comments
 
LVL 52

Expert Comment

by:Carl Tawn
ID: 34135763
How very nice for you :)

Do you have a question about a specific part of that?
0
 
LVL 1

Accepted Solution

by:
dannymd22 earned 500 total points
ID: 36292406

You'll need to provide some more specifics. However, if you want to change a particular field in a particular table, there are two ways to do this, one is by using VBA to call a SQL UPDATE command, such as:

DoCmd.RunSQL "UPDATE TABLE yourTable  SET someField=someValue WHERE someOtherField=someOtherValue "

Open in new window


That is probably the easiest depending on what you are doing. However, you can also use VBA directly by creating a connection to the database's record set. Check out these links for two examples on how to do this:

http://vbadud.blogspot.com/2009/03/how-to-update-access-table-using-vba.html

http://www.techonthenet.com/access/modules/recordset.php

Finally, if you have an open form that is linked to a particular table, you can also just access the controls (like a Textbox, etc) on the form by using the syntax:

Forms!yourFormName.yourFormControl.Value = yourValue

Open in new window


(note, everything with "some" or "your" in the name is something that you name. The rest if part of the code syntax)
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

856 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