?
Solved

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

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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