Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8077843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:36:08+00:00 2026-06-05T15:36:08+00:00

In an access database I have a small function that is called on startup

  • 0

In an access database I have a small function that is called on startup that registers a piece of software for generating barcodes.

When the software is not installed then then Microsoft access runtime errors out, So i would like to add some proper error handling that informs the user of what is causing the problem.

This function is called from a macro on startup and is crashing the database rather than the error handling working properly.

Is my error handling incorrect?

Public Function LicenseTBarCode()
On Error GoTo Err_LicenceTBarCode

Dim TB As New TBarCode10
TB.LicenseMe "<EXPUNGED>", eLicKindSite, 1, "<EXPUNGED>", eLicProd1D
Set TB = Nothing
Exit Function

Err_LicenceTBarCode:
MsgBox "TBarcode Software is not installed. Please contact the database administrator.", vbExclamation, Error
DoCmd.Quit
End Function
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:36:10+00:00Added an answer on June 5, 2026 at 3:36 pm

    Change your code to use late binding:

    Public Function LicenseTBarCode()
    On Error GoTo Err_LicenceTBarCode
    
        Dim TB 
        Set TB = CreateObject("TBarCode10.TBarCode10")
        TB.LicenseMe "<EXPUNGED>", eLicKindSite, 1, "<EXPUNGED>", eLicProd1D
        Set TB = Nothing
        Exit Function
    
    Err_LicenceTBarCode:
        MsgBox "TBarcode Software is not installed. Please contact the database administrator.", vbExclamation, Error
        DoCmd.Quit
    End Function
    

    In order for this to work well, you will really need to use late binding for all of your TBarCode code, including any other TBarCode objects you might be using. If you’re not already familiar with Late Binding it can be a little challenging to understand at first, especially if you are working with any classes that use the factory pattern.

    With late binding, you will uncheck your reference to the DLL and then your code needs to compile without errors. Developing with Late Binding can be challenging since you will not have access to IntelliSense. It works best to develop with Early Binding and then convert your code over to Late Binding later.

    Another thing you lose with Late Binding is any constants that were defined in the original object. You have to create these yourself. Depending on how many you need to use and where all you need to use them, it might be simplest to create a module just to hold these constants. You really only need to have the constants that are actually used in your code.

    Global Const eLicKindSingle = 1 'Single license for exactly one computer
    Global Const eLicKindSite = 2 'Site license for an arbitrary number of computers within one site (or one facility) at one legal address
    Global Const eLicKindDeveloper = 3 'Developer license for redistribution to 3rd party
    Global Const eLicKindWeb = 3 'Web-server license 
    
    Global Const eLicProd1D = 32 '(1D codes)
    Global Const eLicProd2D = 33 '(2D codes)
    

    Alternately, you can just use the values that the constants contain. For example:

    TB.LicenseMe "<EXPUNGED>", 2, 1, "<EXPUNGED>", 32
    

    Also, to my knowledge Late Binding does not work with ActiveX controls. ActiveX Controls are inherently early bound.

    There is another way to handle this problem. I use a “starter” database file that handles some of the prerequisites for the main database. This starter database doesn’t use any references. It only checks the file system to see if the correct files are installed. If they are not, it pops up a messagebox with the correct errors/warnings and then it either runs the main database file or chooses not to run it, depending on the logic you’ve written into it. This is one way to avoid using Late Binding.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small database in Access that works well except for the following
I have code that depends a relatively small MS Jet (created in Access) database.
I have this small VBA script in an Access database. There are a number
I have a ms access database that has one table for each photo album
I have an ms-access database called db.mdb and it contains various table. I;m creating
I have a MS access database. In that, one table consists of questions and
I'm trying to make a small VBScript that compacts a MS Access 2007 database
I have a small MS Access database containing four tables and are struggeling with
I have a small database that I need help designing. I have a VB.NET
I have a split access 2007 database that has been running fine on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.