MS Access opening via code problem

Y

Yuvraj

Hi Guys,

Below is the code which opens another MSAccess.mdb file


Sub Main()

Dim app As Access.Application
Set app = New Access.Application
app.OpenCurrentDatabase "C:\Documents and Settings\" & Environ
("username") & "\desktop\P_Scheduler_final_Test.mdb"

app.Visible = True
app.run "Process"
app.CloseCurrentDatabase
Set app = Nothing
End Sub

The problem is that I want this code to open
P_Scheduler_final_Test.mdb this and on its own go to the Process
macro.

It works but if I run the function the P_Scheduler_final_Test.mdb asks
for the open,cancel and other options. Without clicking Open it does
not goes inside it.

Can't we do something so that
app.OpenCurrentDatabase "C:\Documents and Settings\" & Environ
("username") & "\desktop\P_Scheduler_final_Test.mdb"

code or something to P_Scheduler_final_Test.mdb settings so that it
should not ask me for the options and run on its own

Regards,

Yuvaraj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top