Results 1 to 6 of 6
  1. #1
    Mel_3 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    7

    Can u create a "Computer Program" with Access VBA ?

    Status:
    - Access Database Designed
    - Queries Created
    - Forms, Reports, etc done.
    - You can enter data, run reports, etc.
    - The data base is working.

    Issue:
    - In the background you want a program running that will...
    - Watch the system clock
    - At specified time intervals...
    - Run a query and perform a task based on the data.


    - Do this constantly from the time the operator/admin clicks a "Start App" button in Access until (maybe hours or days or weeks later) the operator/admin clicks the "Stop App" button to stop the background process from running.

    Question:
    - Can you do this with Access VBA so that it is all contained right in MS Access...
    - as opposed to creating the Access DB then writing the "Automation Application" in another language like C++ or C# or whatever.


    Thanks for any help.

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    AFAIK, VBA is not set up to do this stuff. The closest you would come is writing a batch file to start specific macros and then setting up the windows scheduler to run them for you.

    Google is your friend on how to set up the batch process.

  3. #3
    Mel_3 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    7
    I thought the same thing you did until I saw this...

    "Visual Basic for Applications (VBA) is more than just the Macro Language it is most commonly thought of and used as.

    "It has the same abilities normal Visual Basic except Visual Basic for Applications programs can not be compiled into Executables or DLLs."

    from: http://www.natecsystems.com/98%20Sep...l%20Basic.html

    I am very interested in any other comments on this subject...

    Thanks for any help.

  4. #4
    SteveF is offline Generally AccessAble
    Windows XP Access 2010 32bit
    Join Date
    Nov 2010
    Location
    Fourth Corner
    Posts
    123
    Actually, yes, Access can & will do what you want.

    Been there, done that -- Access' VBA is a surprisingly powerful language when approached with a little creativity. Here's the basic logic flow:

    • Build a form in your app that runs in the background; it can hide behind other forms if you'd like.
    • Add a Timer control to the form, set to go off at whatever fixed interval is needed. If the interval varies, then have the timer fire every 60 seconds (or sooner) & compare the system time (retrieved via the Now() function) against a table of pre-set times.
    • At the fixed interval, or the correct system time, run the query & perform the task.
    • Use the "Start App" button to open the background form, and the "Stop App" button to close the background form.


    One caveat: your Access database will need to be up and running for the entire time you need this process to be running. If you close the Access DB, your process will stop when it is closed. Warnings that this process is running prior to shutdown should be installed to prevent improper termination.

    Post back if you need more specific info.

    Steve

  5. #5
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    Ahh, I was under the impression that "- In the background you want a program running that will..." implied that we didn't want Access to be open throughout the process. But yea, what Steve said will work.

  6. #6
    Mel_3 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    7
    Yes, we want Access to be running all the time. 24/7 in fact.

    We will still need the ability to create new records, add/modify/delete data, and do all the standard dB data entry duties... but the "background vba application" will be running all the time...

    ...unless we bring up the start/stop form and click the Stop button

    Questions:

    1 - Can we work with Microsoft Media Foundation stuff from within MS Access VBA?

    2 - Can we instantiate/create .NET objects with VBA?

    Thanks again for the help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Using InfoPath under "Create Email" wizard
    By Alex in forum Import/Export Data
    Replies: 0
    Last Post: 07-21-2010, 07:30 AM
  2. How can I program an "activity indicator"
    By John Southern in forum Programming
    Replies: 5
    Last Post: 06-29-2010, 07:49 AM
  3. Need to update an ancient Access97 "program".
    By Hilton in forum Programming
    Replies: 1
    Last Post: 05-26-2010, 04:47 AM
  4. Replies: 1
    Last Post: 05-13-2010, 10:50 AM
  5. HyperLink error "No Program registered ..."
    By RycherX in forum Access
    Replies: 1
    Last Post: 02-09-2010, 03:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums