• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 118
  • 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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
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

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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