Problem saving value to database using ADODC

Posted on 2006-06-01
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

    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

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    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…

    745 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

    14 Experts available now in Live!

    Get 1:1 Help Now