Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Release the table (Access2003)

    I am having a code written on click.

    When I wanted to run report for the second time I am getting an error
    Database engine can not lock table because it is in use by another process.

    I think I need some release of the table somehow...

    Private Sub cmdRunReport_Click()
    Dim strWhere As String
    On Error GoTo ErrHandler

    DoCmd.SetWarnings False
    DoCmd.OpenQuery "1-qry_Make_Table_R"

    If Not IsNull(Forms!Candidate_Reports!cmbRecruiter) Then
    strWhere = "Name_Display =" & Chr(34) & Forms!Candidate_Reports!cmbRecruiter.Column(0) & Chr(34)

    End If


    DoCmd.OpenReport ReportName:="Report_by_Recruiter", View:=acViewPreview, WhereCondition:=strWhere
    Exit Sub

    ErrHandler:
    If Err = 2501 Then
    ' Report canceled - ignore this
    Else
    MsgBox Err.DESCRIPTION, vbExclamation
    End If
    End Sub

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Release the table (Access2003)

    You may have to delete the table before you do another Make Table. Not sure.

    However, rAther than doing Make Table queries in code, I find it easier to use Append queries. I just run a DELETE query on contents of the table prior to doing the next Append query.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Release the table (Access2003)

    This is the FOURTH time you've asked this question - see the threads starting at <post:=692,481>post 692,481</post:>, <post#=678,850>post 678,850</post#> and <post#=677,752>post 677,752</post#>. You've had the same recommendation then that Mark Liquorman gives you now. What's the point in keeping on asking this?

  4. #4
    5 Star Lounger
    Join Date
    Jan 2005
    Posts
    614
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Release the table (Access2003)

    Memory problem???
    I do remember now and I did change for the Append once but my developmental life is so hectic _ i keep forgetting, sorry!@
    And THANKS!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •