Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

Write conflict in Access using multiple forms per table

Discussion in 'Information Technology' started by Moshe, Nov 18, 2005.

  1. Moshe

    Moshe
    Expand Collapse
    Guest

    Getting a write conflict error when using several forms to enter data to a
    single table. I use the Do.Close + save command to close each form as I move
    from
    one to the next using command buttons on the forms. I tried to change the
    record locks property on the forms to all 3 options but didn't resolve it.
    Any suggestions on how to handle this problem? Thanks
     
  2. Loading...


  3. Albert D.Kallal

    Albert D.Kallal
    Expand Collapse
    Guest

    I always found if I write the record to disk RIGHT before I launch the next
    form, it is ok..


    I use

    me.Refresh
    docmd.openform "form2",,,"id = " & me!id
    docmd.Close acForm,me.name

    You don't show what you code looks like to save the record, but often people
    use

    DoCmd.Save acForm

    The above saves the actual form, and has noting to do with the forms data.

    So, to write the forms data to disk, use

    me.refresh

    In fact, better code is

    if me.Dirty = True then
    me.Dirty = false
    end if

    I often used me.Refresh in place of having to type the above 3 lines of
    text. me.Refresh can actually cause more data transfer activity if the form
    is attached to many records, but as general rule, I don't load forms with
    lots of records, so either approach never matters for me.

    One last thing, if you are NOT closing the previous form, then you REALLY
    need to set the form as "model" in the other properties tab, as this will
    force the user to reverse back the way they opened the forms (if you don't
    do this, then how can one possibly manage what form has saved its data?).
    Using model ensures that when you leave a form, you written the data to
    disk...so you will have no problems.

    So, right before you open the next form, do a

    me.Refresh

    And, also make sure that the forms "model" is set to yes in the other
    tab....do the above two..and you should never have a problem again...

    --
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada
    pleaseNOOSpamKallal@msn.com
    http://www.members.shaw.ca/AlbertKallal
     
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