Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 17th, 2003, 11:16 PM
Registered User
Join Date: Sep 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help! Detect if linked table is available

I am working with an external vendor that provides a "window" into their DB2 mainframe that is updated nightly. I have a gazillion automated reports that need to run as soon as that window is updated. Currently, they maintain a table that holds information on when each table was last updated, but they want to get rid of it. Instead they propose to make the "window" tables temporarily unavailable while they are being updated each night. Then they will be available as soon as the update is complete. They suggest that we just check to see if the tables are available and kick off the reports as soon as they are. We currently link to the tables via ODBC. Can someone please provide some sample code to check to see if a linked table is available? VBA is perfectly fine, but I'm currently limited to Access/VBA in Access.


Old October 3rd, 2003, 04:35 PM
sal sal is offline
Friend of Wrox
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts

I do not know if there is such a thing. Maybe someone else does. Now, the mainframe is updating the table on a set schedule. Find out at what time the mainframe finishes and set-up a task on a server to run an access database right after that is complete. Set-up a macro to run each of your reports (I am assuming that you are exporting them). then create a form that starts with your access database and put this code on the Load event

Private Sub Form_Load()
    Dim stDocName As String

    stDocName = "YourMacroName"
    DoCmd.RunMacro stDocName
End Sub

This should run all of your reports.

Old October 3rd, 2003, 06:39 PM
Registered User
Join Date: Sep 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts

The problem is that the update job is not consistent. So if the reports run and the job hasn't completed or hasn't run at all, they go out blank. Bad for a client-facing app. I already have in place what you suggested for some other reports.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a Make Table Query produce a Linked table? kronik Access 5 May 16th, 2006 06:17 AM
Linked Table sdilucca Access 1 February 24th, 2006 07:29 AM
How to detect if a table exists? mnoon Access 5 February 11th, 2005 09:43 AM
linked table Tasha Access VBA 1 August 6th, 2004 03:04 PM
Detect if linked table is available giswim Access 0 September 17th, 2003 05:07 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.