Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 115
  • Last Modified:

Access wont Compile

I am receiving "variable Not Set" when trying to compile an Access 2010 DB.
dbfailonerror.JPG
0
seamus9909
Asked:
seamus9909
3 Solutions
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Make a backup, then try to Decompile the database first. To do that, create a Shortcut with this as the Target:

"full path to msaccess.exe" "full path to your db" /decompile

Run that shortcut, then try to compile again.
0
 
seamus9909Author Commented:
Did that and still get the error.

Private Sub cmdTestMulti_Click()
CurrentDb.Execute "delete * from tblreportsent where [claimId]=" & Me.ClaimID, dbFailOnError
0
 
PatHartmanCommented:
Did you check for missing references?  When you have a missing reference, the first code you execute that requires a library (any library) will fail.
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
seamus9909Author Commented:
How can I tell which library I am missing in the references?
0
 
Rey Obrero (Capricorn1)Commented:
in your vba window

Tools > References

look for library  prefix with MISSING: <name of library>

uncheck this and find the available library with the same name but different version

then do DEBUG >COMPILE
0
 
Jeffrey CoachmanMIS LiasonCommented:
In addition, ...My guess is that perhaps a library may need to be loaded (in addition to a library perhaps being missing)
So you may have to add a reference to the Microsoft DAO object library perhaps...?

Also try it in a tighter syntax:
Dim strSQL as string
Dim dbs as dao.database
Set dbs=CurrentDB()
strSQL="Delete * FROM tblReportSent WHERE ClaimID=" & me.ClaimID
dbs.excecute strSQL, dbFailOnError

JeffCoachman
0
 
seamus9909Author Commented:
Thanks everyone, It was the DAO object library that was missing!!! Thanks so much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now