Run a module without form ?

G

Guest

Hi

I'd like to have an Access ap that has no GUI and just does its work (which
is using TransferDatabase) when started. I can't seem to find a way of
kicking off my code, which is in a module, without having a form first. Is
that the only way to do it, or am I missing the boat ?

Thanks for help
Balex
 
G

Guest

It depends on when you want the code to run and how you want to stop it.
If it is to start immediately on opening the database, create a macro named
AutoExec. A macro with that name will always run on startup. You will want
to use the RunCode Action. Be aware that macros can only run functions, not
subs, so if your code starts with a sub, either change it to a function or
create a function that does nothing more that call your first sub.

As to when to stop the code? Can't make a suggestion there unless you post
back info on how to know when to stop.
 
G

Guest

Thanks Klatuu

Now I get the next problem: although the database I'm reading from is a
Sybase database defined as an ODBC source, the following statement:

DoCmd.TransferDatabase acImport, "ODBC Database", conn.ConnectionString,
acServerView, "MyView", "MyTable"

gives me the ominous "Could not find installable ISAM" error !

Although using my ODBC definition, I can LINK the SAME view from that same
Sybase database in the SAME Access DB !

What's wrong ?

Balex
 
G

Guest

Sorry, I don't think I can help with this part, I have never used Sybase.
I would suggest you post a new question with this problem.
 
G

Guest

Hi

I've solved that one myself. I had to copy the connection string from my
manual linked table (found in the properties of the link) to my app, and then
it worked. So had nothing to do with Sybase, but the fact that the connection
string that I use to access that DB in the "conventional way" (with conn.Open
and conn.Execute(SQL statemenT) is NOT good enough for the TransferDatabase
statement... Another MS mystery.

Balex
 

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