Code Inconsistent

G

Guest

I have the following lines of code in two different database applications.
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase FileName

In one, these statements open the FileName database in some sort of a
"hidden" window--hidden in the sense that it is not visible on the screen.
In the other, the FileName database is opened in a window that takes over the
screen and prevents a popup form from remaining on top.

I have tried resequencing the statements in relation to the popup form being
opened, but it did not work. I have tried to find an additional parameter
for the OpenCurrentDatabase, but there does not seem to be any.

Can someone give me an idea of why this is happening? Is there some
database setting that I am missing?

Thanks.
 
T

TC

Those two lines should *never* display the opened database, unless you
had the following line somewhere after the CreateObject call:

appAccess.Visible = True

So the fact that case #1 does not display, is expected - not unusual.
The fact that case #2 *does* display, is what is unusual!

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
G

Guest

Thanks for the fast response.

Would it be wise to include a line
appAccess.Visible = False

after the CreateObject call, just to be sure?

Thanks.
 
T

TC

You do understand that your code creates a brand new instance of
Microsoft Access? As if a user had started another copy of Access, from
the Start : Programs menu?

If so, and you want that instance to be visible - set the Visible
property. If you do not want it to be visible - do not set that
property. There's no right or wrong answer - it depends what you want.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
G

Guest

Thanks. I am aware of your concern

I have another question I just came across.

I am using code like the following to export data to text files:
appAccess.DoCmd.TransferText acExportDelim, "Update-B_AFFIL", _
"B_AFFILIATION", T_BAffil, True

My question is with the last parameter that is supposed to output the field
names as the first row. It appears that, even though this parameter is set
to True, the exported text file will only have the field names if the
Import/Export Specification has the Include Field Names on First Row checked
and stored.

Am I seeing that correctly or am I mssing something in my code or elsewhere?

Thanks again.
 
T

TC

Sorry, I don't know that.

Can I suggest that you post that question as a new thread? Sometimes,
when people see that someone is alreading answering a thread, they do
not keep reading the thread themselves. So it generally reduces your
chances of getting an answer, to ask a new question, on a different
topic, at the end of an existing thread; the pool of possible answeres
has been reduced.

Also, when you post a new thread, you can choose a subject line
appropriate to the new question. This also increases your chances of
getting an answer.

Cheers,
TC (MVP Access)
http://tc2.atspace.com
 

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