Solved

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

Posted on 2010-11-15
4
530 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

688 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