Results 1 to 11 of 11

Thread: Error 3008

  1. #1
    Join Date
    Jun 2008
    Posts
    12

    Unanswered: Error 3008

    Hello.

    I am having a tough time filtering my form. There are two forms in question here: frmMenuDataEdit and frmFacilityEdit. I am trying to open frmFacilityEdit (with data) to a record selected on frmMenuDataEdit.

    On frmMenuDataEdit, I have a combo box based on a query that pulls three fields from linking tables together. These three fields are the unique identifiers to each audit (facilityID, date, typeID). No two audits will have the same facility, date, and type. So, I created a query to make this combo box in order to select the audit I wanted to work with. Facility and Type have lookup tables and the query grabs their string names.

    I used the same concept on my Reports Menu. There is a combo box on my menu (based on the same query mentioned above), and when a button is pressed to run the report, it passes the AuditID selected in the combo box to the report. It works perfectly.

    I decided I wanted to do the same thing with my data edit menu, select an audit, and open FORMS to edit the info (versus the previous setup where you had to cycle through ALL audits to find the one you wanted).

    So the code I used to pass the AuditID into frmFacilityEdit is this:

    Code:
    --------------------------------------------------------------------------------

    Private Sub cmdOpenFacilityDataEdit_Click() Dim stDocName As String stDocName = "frmFacilityEdit" DoCmd.OpenForm stDocName, acNormal, , "[AuditID] = " & Me.cmbAuditSelectorEdit DoCmd.Close End Sub
    --------------------------------------------------------------------------------


    I'm getting an error though that says:

    Run-time error '3008'

    The table 'tblFacility' is already opened exclusively by another user, or it is already open through the user interface and cannot be manipulated programmatically.


    I've researched this error and found a few cases like mine, all without any solution.

    Does anyone have any idea?!?!

    Thanks!!!!

  2. #2
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Does cmbAuditSelectorEdit have more than one column? If so, how many and which one contains AuditID? Is the data type for AuditID numeric?

  3. #3
    Join Date
    Jun 2008
    Posts
    12
    Quote Originally Posted by rogue
    Does cmbAuditSelectorEdit have more than one column? If so, how many and which one contains AuditID? Is the data type for AuditID numeric?
    Yes it does.

    It has 4. It is based off a query (qryFacilityAudit) that is based on a main table, and two lookup tables (main: tblFacilityAudit, lookups: tblFacility, tblAuditType)

    The three columns are
    1) AuditID - (from tblFacililityAudit) this is a hidden column
    2) FacilityName - (from tblFacility)
    3) Audit Date - (from tblFacililityAudit)
    4) AuditType - (from tblAuditType)

    tblFacilityAudit has foreign keys FacilityID and AuditTypeID.

    AuditID IS in the query, but is hidden, and yes the data type is numeric.

    Thank You SO MUCH for taking the time to help me. I was just considering a work around that wasn't working very well in my head.

  4. #4
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    Try Me.cmbAuditSelectorEdit.column(0)

  5. #5
    Join Date
    Jun 2008
    Posts
    12
    Quote Originally Posted by rogue
    Try Me.cmbAuditSelectorEdit.column(0)
    It produced the same error and stopped at the same line (open form)....

    Is there a way to 'close' the table it's complaining about with some code?

  6. #6
    Join Date
    Jun 2008
    Posts
    12
    I have noticed something else about this error.

    When I have frmMenuDataEdit (which has the cmbAuditSelectorEdit and a button to open frmFacilityEdit) open, and I try to open frmFacilityEdit from the Database window (in otherwords, not with the button) it'll produce the same error. So I don't think the error lies in the code, it lies in the interaction of these two forms.

    So...I looked at my rowsources and found that I have a combo box that uses tblFacility. I deleted it entirely and that STILL didn't help.

    Like I said, I am doing this EXACT same thing in the reports menu (except it's opening a report and not a form).

    Let me know if there is anything I can do to assist you. I've been on this for 6 hours now, and I've GOT the freaking database sitting in front me. Thanks again.

  7. #7
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    That's strange. Can you remove any sensitive data and upload the mdb file to look at?

  8. #8
    Join Date
    Jun 2008
    Posts
    12
    Quote Originally Posted by rogue
    That's strange. Can you remove any sensitive data and upload the mdb file to look at?
    I think it may be too large, I have posted it at this site:

    http://www.4shared.com/dir/7553777/8...1/sharing.html

    look for newzip

  9. #9
    Join Date
    Jun 2008
    Posts
    12
    I probably should have given you some direction on how to produce the error...whoops (been a long day)

    Open frmMenuDataEdit
    Select an audit
    Try to open Facility Data

  10. #10
    Join Date
    Apr 2004
    Location
    metro Detroit
    Posts
    634
    On frmFacilityEdit check your record locking - you have it set to all records. This prevents the form from being opened if the records are being accessed anywhere else (like the combobox on the criteria form) because the all of the records can not be locked.

    The other thing that I noticed is the docmd.close at the end of the sub - this will close the form that you just opened. You may want to specify what to close.

  11. #11
    Join Date
    Jun 2008
    Posts
    12
    Quote Originally Posted by rogue
    On frmFacilityEdit check your record locking - you have it set to all records. This prevents the form from being opened if the records are being accessed anywhere else (like the combobox on the criteria form) because the all of the records can not be locked.

    The other thing that I noticed is the docmd.close at the end of the sub - this will close the form that you just opened. You may want to specify what to close.
    Masterful, rogue!!!!!

    You are a MASTER!

    I've been fiddling with this thing since 9:00 am this morning. Thank you SO MUCH for having made my day here at 4:15 pm, with the simple changing of a record lock...

    My project is sort of an 'upgrade'. I've inherited this database which 'confuses' the users. (If you look at the navigation arrows at the top of frmFacilityEdit, that's how the users USED to select their audits <-- led to a lot of mis-entered business). So I thought of using this selector combo box, which they had already been using on the reports and had no problem with, to select the audit BEFORE they enter the data entry screens. I've just been copying and pasting the old database objects and really, just updating them. I never would have thought that the lady before me would have changed stuff like that. Apparently...

    Thanks again!

Posting Permissions

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