Table locked when trying to print single report

SG1CSIfan

Registered User.
Local time
Today, 10:01
Joined
Jul 9, 2013
Messages
13
I have a database that has all the employees in my company with basic information. I have a auto number set up for each person. I also have on my form a subform with information about the employee's history in the company. I have bin trying for the last couple weeks, to put a button on my form, that will open up the custom report I made for the one employee, in print preview mode. Everything I have tried gives me a error. The main error I get is The database engine could not lock the table "EmployeeT" because it is already in use by another person or process. If I open the report by itself, then I get all my employees. I am looking to just open a single report from the form I am currently looking at.

I have 2 tables. One Named EmployeeT with all the employees basic information. I have a auto number with the field name EmployeeID.
The 2nd table is called IncidentT, which has its own auto number, and records all the problem/incidents with the employee. For example, lates, if the did not show up, or cancelled out of that day, etc. I have the 2 tables sharing the EmployeeID, sharing the relationship. My main form, has a lot of my information and a subform, Like i said. But no matter what I try I can get rid of that error. I would appriate any advice on this situation.

The only way I got it to work without the error, is when I go into properties and change the Record Set Type to Snapshot on both the form and subform.
but then I can't edit the form or subform anymore. This is driving me nuts, lol.:banghead::banghead::banghead::confused::confused::confused:

Michael

 
How do you open the report from the form?
What is the report's Recordsource?
 
WEll I want to be able to open the report from the form threw a button. The record source for the report is a Querie I created. And the forms record source is the table.
 
Okay - then show the code behind the button and also the query string.
What record lock do you have on the forms, (if it is "All Records" the change it)? (You find it in the data tab for the form's property.)
 
The code behind the button is just threw the wizard. Where basically I put it down and tell it to open a print preview of the report. I have tried many different things with the button, and the onyl way I ever got it to work was threw putting my form and subform in Shapshot mode only.

The string I have for the Query is
SELECT EmployeeT.EmployeeID, EmployeeT.FirstName, EmployeeT.LastName, EmployeeT.DateOfBirth, EmployeeT.Address, EmployeeT.City, EmployeeT.State, EmployeeT.ZipCode, EmployeeT.Email, EmployeeT.CellNumber, EmployeeT.HomeNumber, EmployeeT.AppDate, EmployeeT.HireDate, EmployeeT.EmployeeStatus, EmployeeT.Notes, EmployeeT.Valet, EmployeeT.Director, EmployeeT.VanDriver, EmployeeT.ListA, EmployeeT.ListB, EmployeeT.ListC, EmployeeT.ListAExperationDate, EmployeeT.
[List BExperationDate], EmployeeT.SpecificWorkLocation, EmployeeT.TerminationDate, IncidentT.IncidentID, IncidentT.IncidentDate, IncidentT.TypeOfIncident, IncidentT.Description
FROM EmployeeT INNER JOIN IncidentT ON EmployeeT.EmployeeID = IncidentT.EmployeeID
WHERE (((EmployeeT.EmployeeID)=[Form]![EmployeeF]![EmployeeID]));

And all my record locks are set to Unlock. I have played with this setting with no luck, as far as I know.
 
Could you post the database with some sample data, (zip it because you haven't post 10 post yet.)
 
Still Looking for help on this issue, if anyone has any ideas
 
Sorry I haven't see you have post the database, else I've answer before.
And all my record locks are set to Unlock. I have played with this setting with no luck, as far as I know.
Not quit right - you have record locks on the main report, remove it then it runs.
attachment.php
 

Attachments

  • Locks.jpg
    Locks.jpg
    30.9 KB · Views: 198
OMG thank you so much. I feel stupid missing something that simple. Thanks you so much once again!!!:banghead::D
 
You're welcome - luck with your project.
Yes fresh eyes sees it, therefore check, check and triple check. :D
 

Users who are viewing this thread

Back
Top Bottom