CancelUpdate - problems???

CancelUpdate - problems???

Post by Tony » Thu, 22 Mar 2001 16:54:07



Hi all,

Hope someone can help. I've a form bound to an ADO recordset. If the user
issues the CancelUpdate method in AddMode, the screen is refreshed and the
last record is redisplayed. Which is what I would expect. However, if the
CancelUpdate is issues from EditMode, the contents of the fields are not
refreshed.

I'm just issuing rs.Record.CancelUpdate in both cases....

Should I be doing more.?

I'm working with VB6 sp4, with Access2000

Any Ideas

Tia

Tony

 
 
 

CancelUpdate - problems???

Post by Sukesh Hooga » Thu, 22 Mar 2001 23:03:37


Hi Tony

There is a process called Transaction Management  It has 2 steps -
BeginTrans and ComitTrans or Rollbacktrans. May be this would solve your
problem.
Sukesh


Quote:> Hi all,

> Hope someone can help. I've a form bound to an ADO recordset. If the user
> issues the CancelUpdate method in AddMode, the screen is refreshed and the
> last record is redisplayed. Which is what I would expect. However, if the
> CancelUpdate is issues from EditMode, the contents of the fields are not
> refreshed.

> I'm just issuing rs.Record.CancelUpdate in both cases....

> Should I be doing more.?

> I'm working with VB6 sp4, with Access2000

> Any Ideas

> Tia

> Tony


 
 
 

CancelUpdate - problems???

Post by Steven Elliot » Fri, 23 Mar 2001 05:14:31


The proper syntax is rs.CancelUpdate, not rs.Record.CancelUpdate.
This method works fine for me in both addnew and edit situations.

-Steven Elliott


Quote:> Hi all,

> Hope someone can help. I've a form bound to an ADO recordset. If the user
> issues the CancelUpdate method in AddMode, the screen is refreshed and the
> last record is redisplayed. Which is what I would expect. However, if the
> CancelUpdate is issues from EditMode, the contents of the fields are not
> refreshed.

> I'm just issuing rs.Record.CancelUpdate in both cases....

> Should I be doing more.?

> I'm working with VB6 sp4, with Access2000

> Any Ideas

> Tia

> Tony

 
 
 

CancelUpdate - problems???

Post by Jay » Tue, 27 Mar 2001 14:43:12


Try calling ".Move 0" after calling ".CancelUpdate"

Jay

Quote:-----Original Message-----

Hi all,

Hope someone can help. I've a form bound to an ADO recordset. If the user
issues the CancelUpdate method in AddMode, the screen is refreshed and the
last record is redisplayed. Which is what I would expect. However, if the
CancelUpdate is issues from EditMode, the contents of the fields are not
refreshed.

I'm just issuing rs.Record.CancelUpdate in both cases....

Should I be doing more.?

I'm working with VB6 sp4, with Access2000

Any Ideas

Tia

Tony

.

 
 
 

1. CancelUpdate problems

CancelUpdate is not cancelling my updates or Add commands.  Sample
code follows (the sub which calls the cancel command is at the end):

Public Sub AddRecord()
    ' Adding a tenant is a two step process.  First we will invoke the
    ' add command, then the update command.  So, this button has two

   '  roles

    If addFlag = False Then  ' we are just starting the add operation
        Call AddingTenantsStart

    ElseIf addFlag = True Then  
                         ' we are (hopefully) finishing the add op

        Call addingTenantsFinish
     End If

End Sub

=====================

Public Sub AddingTenantsStart()

    With frmMaster

        ' enable fields for data entry
        setAllMasterDisplayFieldsEnabledToValue (True)

        ' add new record
        .adoMaster.Recordset.AddNew

        ' set all text and combo boxes to empty or initial values
        ' Code not shown here  

        ' Modify display buttons
        ' Some code deleted
        .cmdCancel.Enabled = True  
                   ' So the user can cancel the operation

        addFlag = True        
    End With
End Sub

===================================

Public Sub addingTenantsFinish()

    ' update the record
    frmMaster.adoMaster.Recordset.Update

    ' restore all buttons and menus to default settings
    restoreMasterFormButtonsAndMenusToDefaults

    addFlag = False
    frmMaster.cmdCancel.Enabled = False

End Sub

=================================

Private Sub cmdCancel_Click()
    ' check if we are adding or updating
    If addFlag = True Then
        adoMaster.Recordset.CancelUpdate

'  I tried both of the following -- neither helped:
'        adoMaster.Recordset.Refresh
'        adoMaster.Recordset.Delete

        restoreMasterFormButtonsAndMenusToDefaults
    End If
End Sub

===============

So, I click on the Add button, and start to add some stuff to the data
fields.  Then -- BEFORE clicking Add a second time, which would invoke
the Update operation -- I click Canel to invoke the
recordset.CancelUpdate command.   But, the application still displays
the new record with the newly added information, and it's been added
to the database.  Someone suggested trying only .Cancel or
CancelBatch, but those don't help.

What am I missing?

Thanks,
Steve O.

2. AAArrrrrrrg....What is Up??

3. Weird CancelUpdate problem

4. SOMEONE PLEASE HELP ME!

5. CancelUpdate Problem

6. Problem with meta data browser in EM

7. CancelUpdate problem

8. pgsql-server/doc/src/sgml/ref pg_ctl-ref.sgml

9. CancelUpdate problems

10. problems with Addnew and CancelUpdate

11. problems with CancelUpdate and EditMode

12. Problem with dbgrid and CancelUpdate

13. Problem: CancelUpdate FAILS for a DataGrid bound to Oracle database