Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Problem saving value to database using ADODC

Posted on 2006-06-01
Medium Priority
Last Modified: 2010-04-30
I have  a textbox (txtCode) bound to an ADODC object (adoUpdate) with the following properties:
   DataSource = adoUpdate  
   DataField = dbField

I have a SAVE button that executes the following command:

The following works:
I can click on the textbox and type a new code.  When I click on the SAVE button, the typed code is saved to the database field.

The following does not work:
I can change the textbox using programming syntax (txtCode.text = "new code").  When I click on the SAVE button, the code is NOT saved to the database.

I need to pass a value to the txtCode.text property and then have the value saved to the database.  

Any suggestions why my value is being saved when I TYPE the value in the object, but not saved when I CODE the value to the text property?

Question by:seckel
1 Comment
LVL 13

Accepted Solution

iHadi earned 2000 total points
ID: 16812351
Hi seckel
Try the following:

instead of update use one of the move methods(movenext, movefirst,...). When moving the cursor, it automatically saves changes to the recordset even if you change the text of a textbox by code.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

564 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