Call a function

Posted on 2011-10-30
Last Modified: 2012-05-12
Hey again experts: I convert the Access switchboard macro to VBA today. I now have another problem that I cannot figure out. When the macro was converted it placed a call to a public function but it never worked. This is what it is trying to do: CALL ARGUMENT & "()" but it doesn't work. The argument is a string to the function "ExitDB". Any ideas?
Question by:stevensont
    LVL 61

    Expert Comment

    The code would be like this:

    If ExitDB is the name of your function, you would call it like this:

    Call ExitDB(ARGUMENT)   '<--- This assumes that ARGUMENT is a string vatiable you need to pass to the ExitDB function

    Open in new window

    Equivalent code would be:

    Open in new window


    Author Comment

    Thanks, but argument is the string containing the function name ExitDB.
    LVL 61

    Accepted Solution

    Oh!  Okay....

    try this -

    Dim ARGUMENT as string
    ARGUMENT = "ExitDB()"

    Open in new window


    Author Closing Comment

    The eval function solved the problem

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    The first two articles in this short series — Using a Criteria Form to Filter Records ( and Building a Custom Filter ( — discuss in some detail how a form can be…
    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    761 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

    15 Experts available now in Live!

    Get 1:1 Help Now