Solved

Access wont Compile

Posted on 2015-02-24
7
101 Views
Last Modified: 2016-02-10
I am receiving "variable Not Set" when trying to compile an Access 2010 DB.
dbfailonerror.JPG
0
Comment
Question by:seamus9909
7 Comments
 
LVL 84
ID: 40629298
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
 

Author Comment

by:seamus9909
ID: 40629341
Did that and still get the error.

Private Sub cmdTestMulti_Click()
CurrentDb.Execute "delete * from tblreportsent where [claimId]=" & Me.ClaimID, dbFailOnError
0
 
LVL 34

Assisted Solution

by:PatHartman
PatHartman earned 167 total points
ID: 40629427
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:seamus9909
ID: 40629790
How can I tell which library I am missing in the references?
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 167 total points
ID: 40629827
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
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 166 total points
ID: 40631797
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
 

Author Comment

by:seamus9909
ID: 40632192
Thanks everyone, It was the DAO object library that was missing!!! Thanks so much
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now