By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,505 Members | 1,511 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,505 IT Pros & Developers. It's quick & easy.

Compile error: Can't find project or library

P: 2
Hi, I have this complete Audit database at work that I inherited from someone who left late last year, it has been working fine up until this week. There are report form section that I can select reports by specific topics, but when I select and press that report button, instead of the report opening up, I get the this error message pop up "Compile error: Can't find project or library" and then the Visual BAsic editor opens with code info displayed for the report from I selected. THe windows appear wit the "stLinkCriteria" selected., here is what the code looks like;


Expand|Select|Wrap|Line Numbers
  1. Private Sub Command24_Click()
  2. On Error GoTo Err_BtnAllOutstanding_Click
  3.  
  4.     Dim stDocName As String
  5.  
  6.     stDocName = "frmRptRecomBySection"
  7.     DoCmd.OpenForm stDocName, , , stLinkCriteria
  8.  
  9. Exit_BtnAllOutstanding_Click:
  10.     Exit Sub
  11.  
  12. Err_BtnAllOutstanding_Click:
  13.     MsgBox Err.Description
  14.     Resume Exit_BtnAllOutstanding_Click
  15. End Sub
It nows happens on 3 out of 6 reports which use to work.

Any help or suggestion would be nice.

Cheers
Nekker
Feb 7 '07 #1
Share this Question
Share on Google+
4 Replies


nico5038
Expert 2.5K+
P: 3,072
Try:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command24_Click()
  2. On Error GoTo Err_BtnAllOutstanding_Click
  3.  
  4.     Dim stDocName As String
  5.  
  6.     stDocName = "frmRptRecomBySection"
  7.     DoCmd.OpenForm stDocName
  8.  
  9. Exit_BtnAllOutstanding_Click:
  10.     Exit Sub
  11.  
  12. Err_BtnAllOutstanding_Click:
  13.     MsgBox Err.Description
  14.     Resume Exit_BtnAllOutstanding_Click
  15. End Sub
  16.  
As there's no Dim for the stLinkCriteria and it's not filled either.
Also check or there's no Dim stLinkCriteria at the top of the code...

Nic;o)
Feb 7 '07 #2

MSeda
Expert 100+
P: 159
does it happen on all computers, some, or just yours?
sometimes when updates are applied to other programs (Like Outlook) the references Library gets messed up.
usually the line of code that gets highlighted when this happens has absolutely nothing to do with the error.
in the VB editor click tools then references and see if any are labeled MISSING:
uncheck these.

http://support.microsoft.com/kb/283806
Feb 8 '07 #3

P: 2
I would like to thank you both for your assistance with this matter but MSeda hit the nail on the head. He was spot on with his suggestion, it was exactly the problem the article stated. I removed the tick from the missing reference link and it all works again. I think it was due to a recent upgrade from Office Xp to Office 2003. Anyway, your fast responses have helped me from having to re-create a new database from scratch.

Cheers
Nekker
Feb 8 '07 #4

MSeda
Expert 100+
P: 159
Glad to help.
Feb 8 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.