Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Guest ji, please consider donating today!
      Become a Supporter    ::   Make a Contribution   
    Monthly Recurring Target: $300 :: Achieved: $95

Getting The data has been changed message

Discussion in 'Information Technology' started by Bob, Nov 7, 2005.

  1. Bob

    Bob
    Expand Collapse
    Guest

    Form using bound textbox as well as a combobox
    textbox is bound to table1.field1 combobox is a lookup in table2

    In a button click event on the form, if I write

    Textbox = "123456"
    DoCmd.GoToRecord , , acNext

    This works fine,

    However if I replace the assignment
    Textbox = "123456" with

    textbox = GetNewValue(Someparameter) this GetNewValue does a lookup in
    table2
    (opens a DAO recordset, Dynaset type, finds a fieldvalue, increments it,
    does an edit then an update,closes the recordset and returns the incremented
    value), works fine

    But after it returns the value the asigment to textbox does not work, I get
    an error message data has been changed.

    Can anyone help me with this how do I assign the returned value?

    Thanks,

    Bob
     
  2. Loading...


  3. Tom Wickerath

    Tom Wickerath
    Expand Collapse
    Guest

    Hi Bob,

    If I understand you correctly--and I'm not sure I do--requery your form's
    recordsource so that it will know of the new value added.

    Tom

    http://www.access.qbuilt.com/html/expert_contributors.html
    __________________________________________

    "Bob" wrote:

    Form using bound textbox as well as a combobox
    textbox is bound to table1.field1 combobox is a lookup in table2

    In a button click event on the form, if I write

    Textbox = "123456"
    DoCmd.GoToRecord , , acNext

    This works fine,

    However if I replace the assignment
    Textbox = "123456" with

    textbox = GetNewValue(Someparameter) this GetNewValue does a lookup in
    table2
    (opens a DAO recordset, Dynaset type, finds a fieldvalue, increments it,
    does an edit then an update,closes the recordset and returns the incremented
    value), works fine

    But after it returns the value the asigment to textbox does not work, I get
    an error message data has been changed.

    Can anyone help me with this how do I assign the returned value?

    Thanks,

    Bob
     
  4. Bob

    Bob
    Expand Collapse
    Guest

    I got it solved I think

    If you have a form opened and positionned on a record and use code in a
    another module to update and save some of the same data as that which is
    currently displayed on the form. Then the changes in the module are made to
    a fresh recordset that is opened and closed in the separate module code or
    if you execute an TSQL update statement in the separate module, the form
    seems to consider that change made in the separate module in the same way as
    a change made by another user. So it behaves by telling you someone else
    changed the data but in reality it was you and it should be OK.

    One way I solved it was by bringing the lines of code actually doing the
    change inside the form's own code and use a private function in the form's
    own code.

    Now what I want to do works.

    Bob




    "Tom Wickerath" <AOS168 AT @comcast DOT net> wrote in message
    news:4F331BE9-BB66-43B2-AC2B-B9E4E39E001C@microsoft.com...
    > Hi Bob,
    >
    > If I understand you correctly--and I'm not sure I do--requery your form's
    > recordsource so that it will know of the new value added.
    >
    > Tom
    >
    > http://www.access.qbuilt.com/html/expert_contributors.html
    > __________________________________________
    >
    > "Bob" wrote:
    >
    > Form using bound textbox as well as a combobox
    > textbox is bound to table1.field1 combobox is a lookup in table2
    >
    > In a button click event on the form, if I write
    >
    > Textbox = "123456"
    > DoCmd.GoToRecord , , acNext
    >
    > This works fine,
    >
    > However if I replace the assignment
    > Textbox = "123456" with
    >
    > textbox = GetNewValue(Someparameter) this GetNewValue does a lookup in
    > table2
    > (opens a DAO recordset, Dynaset type, finds a fieldvalue, increments it,
    > does an edit then an update,closes the recordset and returns the
    > incremented
    > value), works fine
    >
    > But after it returns the value the asigment to textbox does not work, I
    > get
    > an error message data has been changed.
    >
    > Can anyone help me with this how do I assign the returned value?
    >
    > Thanks,
    >
    > Bob
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page