Solved

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

Posted on 2010-11-15
4
504 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

759 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now