469,364 Members | 2,398 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,364 developers. It's quick & easy.

Compile error: Can't find project or library

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
4 7143
nico5038
3,080 Expert 2GB
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
159 Expert 100+
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
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
159 Expert 100+
Glad to help.
Feb 8 '07 #5

Post your reply

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

Similar topics

6 posts views Thread by Thomas Connolly | last post: by
5 posts views Thread by TreatmentPlant | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.