?
Solved

Access wont Compile

Posted on 2015-02-24
7
Medium Priority
?
110 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 85
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 38

Assisted Solution

by:PatHartman
PatHartman earned 668 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 668 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 664 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

764 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