Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2010-11-15
4
Medium Priority
?
541 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 2000 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

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.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

610 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