8 Replies - 1039 Views - Last Post: 30 August 2013 - 07:36 PM Rate Topic: -----

#1 ViPluDox  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 22-August 13

Form Auto UpDate Problem

Posted 22 August 2013 - 04:28 AM

HI I'm A bit stuck I'm using VB6 and I have a form open which stores data and it is connected to a Database I have three buttons on there which save edit and cancel but if I type any thing in to my notes box and close the form it updates it even if I don't want to I have looked on Google and stuff but I still cant find the answer any ideas on how I can stop it? thanks ViPluDox :)/>

Is This A Good Question/Topic? 0
  • +

Replies To: Form Auto UpDate Problem

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8962
  • View blog
  • Posts: 33,586
  • Joined: 12-June 08

Re: Form Auto UpDate Problem

Posted 22 August 2013 - 06:39 AM

Folks would have to see your code and how you are binding/kicking off events to the update/insert/delete functions.
Was This Post Helpful? 1
  • +
  • -

#3 ViPluDox  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 22-August 13

Re: Form Auto UpDate Problem

Posted 22 August 2013 - 06:52 AM

ok my code is
[private sub cmdEdit_Click()
     txtnotes.locked = false            <----- edit button
     Dataclient.recordset.cancelUpdate
 end sub]

[private sub cmdCancel_Click()
     txtnotes.locked = True         <------- cancel button
     Dataclient.recordset.cancelUpdate
 end sub]

[private sub cmdSave_click()
     txtnotes.locked = true        <------- save button
 end sub]



that's the code I have it works fine it just updates the form when I close it down and I don't really want that to happen. I have the data base set up through the properties of the data button I just need it to stop updating that's all :L

This post has been edited by modi123_1: 22 August 2013 - 06:56 AM
Reason for edit:: please use the code tags

Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8962
  • View blog
  • Posts: 33,586
  • Joined: 12-June 08

Re: Form Auto UpDate Problem

Posted 22 August 2013 - 06:58 AM

You are sure that is all your code? Since you are not showing me the complete project for me to trace for you - you'll have to do that heavy lifting. Put a breakpoint on your update method.. run your form.. do your edits.. and close it. If the close action is triggering an update it should stop on that breakpoint and you can trace up the stack to find where it is being called and work out the logic knot there.
Was This Post Helpful? 0
  • +
  • -

#5 ViPluDox  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 22-August 13

Re: Form Auto UpDate Problem

Posted 22 August 2013 - 07:04 AM

yea that's all of it and ok cheers for the advice and sorry about the code tags
Was This Post Helpful? 0
  • +
  • -

#6 ViPluDox  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 22-August 13

Re: Form Auto UpDate Problem

Posted 22 August 2013 - 07:14 AM

I forgot to say as well its a DOA so the textboxes are connected to the data so there is no routine for the update it just happens when the form closes
Was This Post Helpful? 0
  • +
  • -

#7 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Form Auto UpDate Problem

Posted 22 August 2013 - 07:18 AM

The update on exit is a feature of the DataControl as detailed below:

Quote

RecordSet Methods
Data1.RecordSet.AddNew
adds a new record to the recordset
Data1.RecordSet.Delete
deletes the current record
Data1.RecordSet.MoveNext
moves to the next record in the recordset
Data1.RecordSet.MovePrevious
moves to the previous record
Data1.RecordSet.MoveFirst
moves to the first record
Data1.RecordSet.MoveLast
moves to the last record
Data1.UpdateRecord
saves a changed record. This is also done automatically when you use any of the Move methods. With VB6, this is also done automatically when the control is unloaded (when your application exits).


Might be worth looking the more up to date ADO methods as opposed to DAO?

I'm not that clued up in this area, but some of the experts here may well suggest the same.
Was This Post Helpful? 1
  • +
  • -

#8 ViPluDox  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 22-August 13

Re: Form Auto UpDate Problem

Posted 22 August 2013 - 07:21 AM

ok thank you :)
Was This Post Helpful? 0
  • +
  • -

#9 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 574
  • View blog
  • Posts: 2,989
  • Joined: 19-May 09

Re: Form Auto UpDate Problem

Posted 30 August 2013 - 07:36 PM

Don't use the data control. Learn to use ADO. You can use DAO too if you have to. Your problem, however, is that you are using the Data Control. I prefer personally not to use data binding either. You can write a rprocedure to update all of your controls with the data in your recordset. Then just set up buttons, and work out the logic of what you have to do to perform whatever data function you need.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1