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

Locked table problem

Discussion in 'Information Technology' started by Phil Hellmuth, Jul 28, 2006.

  1. Phil Hellmuth

    Phil Hellmuth
    Expand Collapse
    Guest

    I have a form that has an After Insert event. During the event, a row
    is inserted into a table which is the record source of a subform on the
    form. When inserting a row on the form, all goes as planned. If the
    form is open in Datasheet view, and insert a record, again, all goes as
    designed. However, if I attempt to paste/append multiple rows, each
    attempt to add a row in the After Insert event fails with a
    "could not read the record; currently locked by another user." message.
    Googling this message returned no results.

    Any suggestions? Thanks in advance.
     
  2. Loading...

    Similar Threads Forum Date
    India Raid finds several schools locked Breaking News Sep 23, 2012
    Sikh News Jagdish Tytler's UK visit blocked over 1984 Sikh Massacre Breaking News Nov 6, 2009
    As A Child, Public Marches Of Sikhism Made Me Uncomfortable. They Still Do . Why ? Whats The Logic Hard Talk Oct 16, 2016
    Arts/Society Backyard Vegetable Garden Language, Arts & Culture Dec 27, 2013
    Heritage Now a Vegetable Market, Ranjit Singh's Royal Haveli a Picture of Neglect History of Sikhism Nov 11, 2013

  3. strive4peace

    strive4peace
    Expand Collapse
    Guest

    Hi Phil,

    What method are you using to insert rows? I would suggest
    an APPEND Query...

    '~~~~~~~~~~~~~~~~~
    dim strSQL as string
    strSQL = "INSERT INTO Tablename " _
    "(numfield, strfield, datefield ) " _
    "SELECT " & NumVariable & ", '" _
    & strVariable & "', #" _
    & dateVariable & "#;"
    debug.print strSQL
    currentdb.execute strSQL

    currentdb.tabledefs.refresh
    DoEvents
    me.subform_controlname.form.requery
    '~~~~~~~~~~~~~~~~~


    ** debug.print ***

    debug.print strSQL

    --> this prints a copy of the SQL statement to the debug
    window (CTRL-G)

    After you execute your code, open the Debug window
    CTRL-G to Goto the debuG window -- look at the SQL statement

    If the SQL statement has an error

    1. Make a new query (design view)

    2. choose View, SQL from the menu
    (or SQL from the toolbar, first icon)

    3. cut the SQL statement from the debug window
    (select, CTRL-X)

    4. paste into the SQL window of the Query
    (CTRL-V)

    5. run ! from the SQL window
    -- Access will tell you where the problem is in the SQL


    Warm Regards,
    Crystal
    Microsoft Access MVP 2006

    *
    Have an awesome day ;)

    remote programming and training
    strive4peace2006 at yahoo.com

    *

    Phil Hellmuth wrote:
    > I have a form that has an After Insert event. During the event, a row
    > is inserted into a table which is the record source of a subform on the
    > form. When inserting a row on the form, all goes as planned. If the
    > form is open in Datasheet view, and insert a record, again, all goes as
    > designed. However, if I attempt to paste/append multiple rows, each
    > attempt to add a row in the After Insert event fails with a
    > "could not read the record; currently locked by another user." message.
    > Googling this message returned no results.
    >
    > Any suggestions? Thanks in advance.
     
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