Welcome to SPN

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

Sign Up Now!

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
     

Share This Page