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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error handling in Report

Status
Not open for further replies.

mickier

Programmer
Jul 5, 2001
17
US
I am running the following code on a button. This runs 2 queries that combines two tables into one. Then a report opens. However, I guess 2 people can't use this report at once because whenever you try to open it when someone else is looking at it, you get an error message. NOT the error handling I have programed ("please try again later").
#1. Why can't 2 people view the report at the same time?
#2. Why doesn't it use my error handling code?
Thanks in advance!
Mickie

Private Sub ALABFIFOLIST_Click()
DoCmd.OpenForm "Please Wait"
DoCmd.SetWarnings False
DoCmd.Hourglass True
DoCmd.OpenQuery "Complaint Testing FIFO maketable"
DoCmd.OpenQuery "QCLOG FIFO appendtable"
DoCmd.Hourglass False
Forms![please wait].SetFocus
DoCmd.Close
DoCmd.SetWarnings True
On Error GoTo Err_ALABFIFOLIST_Click
Dim stDocName As String
stDocName = "ALAB FIFO Report"
DoCmd.OpenReport stDocName, acPreview
Exit_ALABFIFOLIST_Click:
Exit Sub
Err_ALABFIFOLIST_Click:
MsgBox ("Please try again in a moment. The report is currently open")
Resume Exit_ALABFIFOLIST_Click
End Sub
 
Are you getting an error number on your error? Jim Lunde
compugeeks@hotmail.com
Custom Application Development
 
RunTime error 3262
Couldn't lock table. Currently in use by X on machine X. Mickie ~:)
 
I have seen this error when a table is open for design by another user and also when the database is not set up as a shared database, but rather an exclusive database To change to shared:Under Tools, Options, Advanced tab, Default Open Mode = Shared
 
The database is shared. It is being used by our whole company for lab data collection.
Is it the Query that the report is based on? Can that be opened by more than one user?
ARG! Mickie ~:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top