Hi, still learning VBA…. can anyone help with this? I have a database which gets data from dbs which are FTP’d into a holding area a few times a day. When it is opened, a query runs which pulls data from 5 databases, and makes it into one table, which in turn links to the main application. The child database then quits. I want to be able to run this process from the main application directly, but haven’t done this before. Taking Access’s example, my code looks like this:
Private Sub Cmd_OpenApp_Click()
On Error GoTo Err_Cmd_OpenApp_Click
DoCmd.SetWarnings False
MsgBox (“You are about to update the data in your price tables. Proceed?”), vbOKCancel
Dim appAccess As Access.Application
Const strConPathToDatabase = “C:My DocumentsEuropean Market”
Dim strDB As String
strDB = strConPathToDatabase & “EuropeanPrices.mdb”
Set appAccess = _
CreateObject(“Access.Application.8”)
appAccess.OpenCurrentDatabase strDB
appAccess.DoCmd.OpenForm “Frm1”
Exit_Cmd_OpenApp_Click:
Exit Sub
Err_Cmd_OpenApp_Click:
MsgBox Err.Description
Resume Exit_Cmd_OpenApp_Click
DoCmd.SetWarnings True
End Sub
The whole process works just fine, but all the same I get an error box telling me that the action will not run because access is performing another action, and to perform the action later. Can anyone tell me why this is, and what I can do to get rid of the message box, which will just confuse my users?
many thanks.