Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error trying to email a report from a form with a macro

Status
Not open for further replies.

rsales

Technical User
Jul 27, 2001
8
US
I have an entry form that has a button which runs a macro to email a snapshot of a report showing the data that is currently displayed in the form. Problem is when you click the button it says, "The database engine could not lock table because it is already in use by another person or process". Strange thing is I was playing around with things and it actually worked once. I currently have record locking off in both the form, the report and the advanced options trying to find the reason for the error code but I am still getting the error. I'm not an advanced user so I am not creating these functions by writing code. Anyone have any ideas? Thanks.
 
try to close the mdb or mde file and then goto the location where the file is stored and try deleting the *.ldb file if you cant delete it find out who else is using that file if its only you try restarting you computer and then delete that file

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
That file is created when I go into the database and deleted when I close Access. It can't be deleted while I am in the database.
 
i know that but the error tells you that its in use so if the file is there even after you close it i suggest you should restart your computer and then go ahead and delete it

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
The file is only there when I am in the database. When I close the database it's gone and so is the form for use. I also tried rebooting but that had no effect.
 
did you try to run the macro when the form is closed and see what it dose and dose it still have that error if yes please can you type up what you got in that macro

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
The macro works if the form is closed.

 
Here's what's in the macro:

Action: SendObject
Object type: Report
Object Name: Roof Repairs
Output Format: Snapshot Format
To: email@mail.com
 
well is it possible you should close the form while the macro is runing and then reopen it

i know it sounds stupid

i need to think of something


I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
is taht form based on a query or just a table

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
Well I tried it both ways. Based on the table and based on a query. Same error both ways. I have even tried different setting in the properties of the form. Unless I missed something I couldn't find a combination that worked.

This is another approach I am trying since my attempt at a page didn't work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top