<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Window behaviour in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/window-behaviour/m-p/349254#M77177</link>
    <description>Hi Hendie,&lt;BR /&gt;
	The quick fix is just to eliminate one line of code in your sub. remove &lt;BR /&gt;
or comment out the line:&lt;BR /&gt;
Access.Application.Visible = True&lt;BR /&gt;
&lt;BR /&gt;
This should stop Access from popping up on your screen. But in addition &lt;BR /&gt;
you may want to look into using dao or ado to retrieve info from the &lt;BR /&gt;
database. If you decide to do so, ado is the up and coming while dao is &lt;BR /&gt;
on it's way out. So if you have to learn it, ado is probably the better &lt;BR /&gt;
choice. This will allow you to read or write to the database even if &lt;BR /&gt;
Access is not installed on your machine. To use one or the other, just &lt;BR /&gt;
check the box under tools, references. All the new methods will appear &lt;BR /&gt;
in your object browser and the help files have samples. There are also &lt;BR /&gt;
quite a few of us on this ng who write in ado or dao if you have questions.&lt;BR /&gt;
-Josh&lt;BR /&gt;
&lt;BR /&gt;
hendie wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; I created a small utility which ran a query on an Access database. When &lt;BR /&gt;
&amp;gt; I first ran it (on Windows 95)only a small dialogue box appeared &lt;BR /&gt;
&amp;gt; requesting the user to enter criteria.(Access stayed minimised) When we &lt;BR /&gt;
&amp;gt; upgraded to Windows NT and now 2000, Access pops up in front of Autocad &lt;BR /&gt;
&amp;gt; followed by the dialogue box. ~ It doesn't stop the form from working &lt;BR /&gt;
&amp;gt; but it's not as neat as I would like it. Can anyone explain why this &lt;BR /&gt;
&amp;gt; change should have happened without any change in the code ? Should teh &lt;BR /&gt;
&amp;gt; code be amended in any way ?~ I've posted the code below. I'm a relative &lt;BR /&gt;
&amp;gt; newcomer and completely self taught so forgive me if my code is untidy &lt;BR /&gt;
&amp;gt; and contains any useless baggage. *****Code starts here****&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Private Sub Getinfo_Click()&lt;BR /&gt;
&amp;gt;     InfoBase = "P:\Gore\material.mdb"&lt;BR /&gt;
&amp;gt;     Set Access = New Access.Application&lt;BR /&gt;
&amp;gt;     Access.OpenCurrentDatabase InfoBase&lt;BR /&gt;
&amp;gt;     Access.Application.Visible = True&lt;BR /&gt;
&amp;gt;     On Error Resume Next&lt;BR /&gt;
&amp;gt;     Access.DoCmd.OpenQuery "Mat1", , acReadOnly&lt;BR /&gt;
&amp;gt;     Access.DoCmd.GoToRecord acDataQuery, "Mat1", acGoTo, 1&lt;BR /&gt;
&amp;gt;     Access.DoCmd.DoMenuItem acFormBar, acEditMenu, acSelectRecord, , &lt;BR /&gt;
&amp;gt; acMenuVer70&lt;BR /&gt;
&amp;gt;     Access.DoCmd.DoMenuItem acFormBar, acEditMenu, acCopy, , acMenuVer70&lt;BR /&gt;
&amp;gt;     Access.DoCmd.Close acQuery, "mat1", acSaveNo&lt;BR /&gt;
&amp;gt;     Access.CloseCurrentDatabase&lt;BR /&gt;
&amp;gt;     Set Access = Nothing&lt;BR /&gt;
&amp;gt;     Infotext.SetFocus&lt;BR /&gt;
&amp;gt;     Infotext.Paste&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; * ****Code ends here***** ~ Hendie</description>
    <pubDate>Fri, 08 Feb 2002 10:24:31 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2002-02-08T10:24:31Z</dc:date>
    <item>
      <title>Window behaviour</title>
      <link>https://forums.autodesk.com/t5/vba-forum/window-behaviour/m-p/349253#M77176</link>
      <description>I created a small utility which ran a query on an Access database. When I first ran it (on Windows 95)only a small dialogue box appeared requesting the user to enter criteria.(Access stayed minimised) When we upgraded to Windows NT and now 2000, Access pops up in front of Autocad followed by the dialogue box. ~ It doesn't stop the form from working but it's not as neat as I would like it. Can anyone explain why this change should have happened without any change in the code ? Should teh code be amended in any way ?~ I've posted the code below. I'm a relative newcomer and completely self taught so forgive me if my code is untidy and contains any useless baggage. *****Code starts here****  &lt;BR /&gt;
&lt;BR /&gt;
Private Sub Getinfo_Click()&lt;BR /&gt;
    InfoBase = "P:\Gore\material.mdb"&lt;BR /&gt;
    Set Access = New Access.Application&lt;BR /&gt;
    Access.OpenCurrentDatabase InfoBase&lt;BR /&gt;
    Access.Application.Visible = True&lt;BR /&gt;
    On Error Resume Next&lt;BR /&gt;
    Access.DoCmd.OpenQuery "Mat1", , acReadOnly&lt;BR /&gt;
    Access.DoCmd.GoToRecord acDataQuery, "Mat1", acGoTo, 1&lt;BR /&gt;
    Access.DoCmd.DoMenuItem acFormBar, acEditMenu, acSelectRecord, , acMenuVer70&lt;BR /&gt;
    Access.DoCmd.DoMenuItem acFormBar, acEditMenu, acCopy, , acMenuVer70&lt;BR /&gt;
    Access.DoCmd.Close acQuery, "mat1", acSaveNo&lt;BR /&gt;
    Access.CloseCurrentDatabase&lt;BR /&gt;
    Set Access = Nothing&lt;BR /&gt;
    Infotext.SetFocus&lt;BR /&gt;
    Infotext.Paste&lt;BR /&gt;
End Sub&lt;BR /&gt;
*****Code ends here*****&lt;BR /&gt;
~ Hendie</description>
      <pubDate>Fri, 08 Feb 2002 02:51:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/window-behaviour/m-p/349253#M77176</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-02-08T02:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Window behaviour</title>
      <link>https://forums.autodesk.com/t5/vba-forum/window-behaviour/m-p/349254#M77177</link>
      <description>Hi Hendie,&lt;BR /&gt;
	The quick fix is just to eliminate one line of code in your sub. remove &lt;BR /&gt;
or comment out the line:&lt;BR /&gt;
Access.Application.Visible = True&lt;BR /&gt;
&lt;BR /&gt;
This should stop Access from popping up on your screen. But in addition &lt;BR /&gt;
you may want to look into using dao or ado to retrieve info from the &lt;BR /&gt;
database. If you decide to do so, ado is the up and coming while dao is &lt;BR /&gt;
on it's way out. So if you have to learn it, ado is probably the better &lt;BR /&gt;
choice. This will allow you to read or write to the database even if &lt;BR /&gt;
Access is not installed on your machine. To use one or the other, just &lt;BR /&gt;
check the box under tools, references. All the new methods will appear &lt;BR /&gt;
in your object browser and the help files have samples. There are also &lt;BR /&gt;
quite a few of us on this ng who write in ado or dao if you have questions.&lt;BR /&gt;
-Josh&lt;BR /&gt;
&lt;BR /&gt;
hendie wrote:&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; I created a small utility which ran a query on an Access database. When &lt;BR /&gt;
&amp;gt; I first ran it (on Windows 95)only a small dialogue box appeared &lt;BR /&gt;
&amp;gt; requesting the user to enter criteria.(Access stayed minimised) When we &lt;BR /&gt;
&amp;gt; upgraded to Windows NT and now 2000, Access pops up in front of Autocad &lt;BR /&gt;
&amp;gt; followed by the dialogue box. ~ It doesn't stop the form from working &lt;BR /&gt;
&amp;gt; but it's not as neat as I would like it. Can anyone explain why this &lt;BR /&gt;
&amp;gt; change should have happened without any change in the code ? Should teh &lt;BR /&gt;
&amp;gt; code be amended in any way ?~ I've posted the code below. I'm a relative &lt;BR /&gt;
&amp;gt; newcomer and completely self taught so forgive me if my code is untidy &lt;BR /&gt;
&amp;gt; and contains any useless baggage. *****Code starts here****&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; Private Sub Getinfo_Click()&lt;BR /&gt;
&amp;gt;     InfoBase = "P:\Gore\material.mdb"&lt;BR /&gt;
&amp;gt;     Set Access = New Access.Application&lt;BR /&gt;
&amp;gt;     Access.OpenCurrentDatabase InfoBase&lt;BR /&gt;
&amp;gt;     Access.Application.Visible = True&lt;BR /&gt;
&amp;gt;     On Error Resume Next&lt;BR /&gt;
&amp;gt;     Access.DoCmd.OpenQuery "Mat1", , acReadOnly&lt;BR /&gt;
&amp;gt;     Access.DoCmd.GoToRecord acDataQuery, "Mat1", acGoTo, 1&lt;BR /&gt;
&amp;gt;     Access.DoCmd.DoMenuItem acFormBar, acEditMenu, acSelectRecord, , &lt;BR /&gt;
&amp;gt; acMenuVer70&lt;BR /&gt;
&amp;gt;     Access.DoCmd.DoMenuItem acFormBar, acEditMenu, acCopy, , acMenuVer70&lt;BR /&gt;
&amp;gt;     Access.DoCmd.Close acQuery, "mat1", acSaveNo&lt;BR /&gt;
&amp;gt;     Access.CloseCurrentDatabase&lt;BR /&gt;
&amp;gt;     Set Access = Nothing&lt;BR /&gt;
&amp;gt;     Infotext.SetFocus&lt;BR /&gt;
&amp;gt;     Infotext.Paste&lt;BR /&gt;
&amp;gt; End Sub&lt;BR /&gt;
&amp;gt; &lt;BR /&gt;
&amp;gt; * ****Code ends here***** ~ Hendie</description>
      <pubDate>Fri, 08 Feb 2002 10:24:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/window-behaviour/m-p/349254#M77177</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-02-08T10:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Window behaviour</title>
      <link>https://forums.autodesk.com/t5/vba-forum/window-behaviour/m-p/349255#M77178</link>
      <description>&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;It is not good way to retrieve little piece of &lt;BR /&gt;
information by lauching an Access application, having Access run a query, copy &lt;BR /&gt;
it to Windows clipboard, quiting Access and finally pasting the data oo your &lt;BR /&gt;
small utitly's form. Not only its slow speed of this tedius procedure (only &lt;BR /&gt;
having Avccess started will take anywhere between 5 to 20 seconds) is undesired, &lt;BR /&gt;
but also&amp;nbsp;it needs Access being installed on the computer, which uses your &lt;BR /&gt;
untitly.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;Use either DAO or ADO to access data in an Access &lt;BR /&gt;
database. In your case, only a fraction of second is enough to retrieve the data &lt;BR /&gt;
you need, and you do not actually need to install Access on the computer as long &lt;BR /&gt;
as the .mdb file is accessible.&lt;/FONT&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;DIV&gt;&lt;FONT face="Arial" size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"&amp;gt;&lt;BR /&gt;
  &lt;DIV&gt;"hendie" &amp;lt;&lt;A&gt;&lt;BR /&gt;
  href="mailto:ahenders@wlgore.com"&amp;gt;ahenders@wlgore.com&lt;/A&gt;&amp;gt; wrote in message &lt;BR /&gt;
  &lt;A&gt;&lt;BR /&gt;
  href="news:f0b5f38.-1@WebX.maYIadrTaRb"&amp;gt;news:f0b5f38.-1@WebX.maYIadrTaRb&lt;/A&gt;...&lt;/DIV&gt;I &lt;BR /&gt;
  created a small utility which ran a query on an Access database. When I first &lt;BR /&gt;
  ran it (on Windows 95)only a small dialogue box appeared requesting the user &lt;BR /&gt;
  to enter criteria.(Access stayed minimised) When we upgraded to Windows NT and &lt;BR /&gt;
  now 2000, Access pops up in front of Autocad followed by the dialogue box. ~ &lt;BR /&gt;
  It doesn't stop the form from working but it's not as neat as I would like it. &lt;BR /&gt;
  Can anyone explain why this change should have happened without any change in &lt;BR /&gt;
  the code ? Should teh code be amended in any way ?~ I've posted the code &lt;BR /&gt;
  below. I'm a relative newcomer and completely self taught so forgive me if my &lt;BR /&gt;
  code is untidy and contains any useless baggage. *****Code starts here**** &lt;BR /&gt;
  &lt;P&gt;Private Sub Getinfo_Click() &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;InfoBase = &lt;BR /&gt;
  "P:\Gore\material.mdb" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Set Access = New &lt;BR /&gt;
  Access.Application &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Access.OpenCurrentDatabase &lt;BR /&gt;
  InfoBase &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Access.Application.Visible = True &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;On Error Resume Next &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Access.DoCmd.OpenQuery "Mat1", , acReadOnly &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Access.DoCmd.GoToRecord acDataQuery, "Mat1", &lt;BR /&gt;
  acGoTo, 1 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Access.DoCmd.DoMenuItem acFormBar, &lt;BR /&gt;
  acEditMenu, acSelectRecord, , acMenuVer70 &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Access.DoCmd.DoMenuItem acFormBar, acEditMenu, &lt;BR /&gt;
  acCopy, , acMenuVer70 &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Access.DoCmd.Close acQuery, &lt;BR /&gt;
  "mat1", acSaveNo &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Access.CloseCurrentDatabase &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Set Access = Nothing &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Infotext.SetFocus &lt;BR /&gt;
  &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Infotext.Paste &lt;BR /&gt;End Sub &lt;BR /&gt;
  &lt;LI&gt;****Code ends here***** ~ Hendie&lt;/LI&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Fri, 08 Feb 2002 11:33:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/window-behaviour/m-p/349255#M77178</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2002-02-08T11:33:59Z</dc:date>
    </item>
  </channel>
</rss>

