473,831 Members | 2,230 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dark gray, blank screen when app opens via vb script.

I use the following script to open an Access app, to avoid the security
warnings:

dim o
set o=createobject ("Access.Applic ation")
o.automationsec urity=1 'set macro security LOW.
o.opencurrentda tabase "\\spacehab.com \files\SHApps\E PRD\Live\eprd.4 .50a.mde"
o.usercontrol=t rue
set o=nothing

(We tried certificates but neither I nor our IT people could get it to work
properly, so we fell back on this. ICYWW)

The "4.50" reflects the version of the app in the production directory.

Been using this for about a year. No problem. App opens fine every time.

Until today.

I decided that I wanted form A to open after form B instead of before.
Nothing else. I cut the openform line, moved up about 10 lines, pasted it
back in.

Runing locally, as the mdb, no problem. The effect is perfect. I "compile"
to mde, copy to the file server, and run the mde from there, manually, not
through the script. Runs fine. Identical to how it ran on my workstation
as an MDB. Now I change my vb script to use the new file name
(eprd.4.50b.mde for this example), and things go completely to hell. Access
opens. In my taskbar I can see the name of all the forms that I expect to
be open, but none of them are visible.

There are no vertical or horizontal scroll bars. The forms themselgves do
nothing remarkable. One is a menu form with a graphic and a listbox. One
is review of items to do, with a couple of listboxes and a couple of
commandbuttons.

To recap: The existing vb script opens the previous version of the app just
fine. If I copy that script file and change it to open the new version of
the app, everything goes to hell. If I open the new version of the app
manually, everything is fine.

I've restarted, shut down and power back up, repaired my Office
installation, and now I'm trolling for ideas.
Jun 1 '06 #1
5 2051
On Thu, 01 Jun 2006 21:48:43 GMT, "Rick Wannall"
<wa*****@notado main.de> wrote:

Very unusual.
Put a "Stop" instruction at the top of your code, and then step
through it in the debugger. I'm expecting an "aha Erlebniss".

-Tom.

I use the following script to open an Access app, to avoid the security
warnings:

dim o
set o=createobject ("Access.Applic ation")
o.automationse curity=1 'set macro security LOW.
o.opencurrentd atabase "\\spacehab.com \files\SHApps\E PRD\Live\eprd.4 .50a.mde"
o.usercontrol= true
set o=nothing

(We tried certificates but neither I nor our IT people could get it to work
properly, so we fell back on this. ICYWW)

The "4.50" reflects the version of the app in the production directory.

Been using this for about a year. No problem. App opens fine every time.

Until today.

I decided that I wanted form A to open after form B instead of before.
Nothing else. I cut the openform line, moved up about 10 lines, pasted it
back in.

Runing locally, as the mdb, no problem. The effect is perfect. I "compile"
to mde, copy to the file server, and run the mde from there, manually, not
through the script. Runs fine. Identical to how it ran on my workstation
as an MDB. Now I change my vb script to use the new file name
(eprd.4.50b.md e for this example), and things go completely to hell. Access
opens. In my taskbar I can see the name of all the forms that I expect to
be open, but none of them are visible.

There are no vertical or horizontal scroll bars. The forms themselgves do
nothing remarkable. One is a menu form with a graphic and a listbox. One
is review of items to do, with a couple of listboxes and a couple of
commandbuttons .

To recap: The existing vb script opens the previous version of the app just
fine. If I copy that script file and change it to open the new version of
the app, everything goes to hell. If I open the new version of the app
manually, everything is fine.

I've restarted, shut down and power back up, repaired my Office
installation , and now I'm trolling for ideas.


Jun 2 '06 #2
Do I ever hope you're right!
Jun 2 '06 #3
Rick Wannall wrote:
Do I ever hope you're right!


It sounds like you are pointing to a record that doesn't exist. Ex:
Docmd.Openform "x",,,"ID = 1"
and there is no id#1.
Jun 2 '06 #4
There is no attempt to point at any record. I rarely use bound forms
anyway, but that's a side issue.

There should be 3 forms visible, just sitting there, ready for the user to
do something on one of them. (One of them actually closes itself on a timer
after 20 seconds.)

Sadly, the problem does not occur when starting the MDB from the script, so
following the code throught the opening sequence is pointless, since the
problem does not appear.

It seems so odd that the form names show up on my task bar, exactly as they
should. They seem to be open. They're just not visible, and there are no
scroll bars to get to them, and there's not code setting them invisible.
And if there were, there are no menus available period, so I couldn't unhide
a form even if that were the problem.

This one I don't get.
Jun 2 '06 #5
OK. Got the answer, sort of. I know the code it's related to, and I know
that it has something to do with timing, and that's probably as far as I'll
chase it.

It all started when I moved this line of code:

Call MaximizeApplica tionIfNotAlread y

That line of code was previously called only in two places, activated when
the user's mouse moved over an area on a form. I was so convinced that
moving and positioning forms (which I also added) and maximizing a window
were such vanilla, absolutely uninteresting actions that I sort of
overlooked them in my mental checklist. Looks like I'm learning this
lesson, yet again: Never, ever overlook anything.

I inserted that line additionally into my opening stream of code. That's
what caused the problem. My startup form does some login validation and
link checking, then it opens 3 forms. I was thinking that I might go ahead
and maximize after opening the forms. Wrong. I could not find any place in
that stream of activity that I could leave that line of code and wind up
with forms visible when the application opened.

I yield to the intransigence of the immutable unknown, so I removed the line
and copied it to the MouseMove event of the detail section of the 4 forms
that could possibly wind up open, depending on user preference settings.

Works like a charm.

For those who care, the functions invoked by the offending line are shown
below.

I guess that in programming, as in comedy, timing is everything.

=============== =============== =============== =========
Public Function MaximizeApplica tionIfNotAlread y()

If IsAccessMaximiz ed = False Then
Call AccessMaximize
End If

End Function

Function IsAccessMaximiz ed() As Boolean
If apiIsZoomed(Get AccesshWnd()) = 0 Then
IsAccessMaximiz ed = False
Else
IsAccessMaximiz ed = True
End If
End Function

Function AccessMaximize( )
AccessMaximize = apiShowWindow(G etAccesshWnd(), SW_MAXIMIZE)
End Function

Declare Function apiIsZoomed Lib "user32" Alias "IsZoomed" (ByVal Hwnd As
Long) As Long
Declare Function apiShowWindow Lib "user32" Alias "ShowWindow " (ByVal Hwnd
As Long, ByVal nCmdShow As Long) As Long
Jun 2 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3541
by: Philippe Meunier | last post by:
Hi, I am using the .NET toolbar with VB.NET 2003. My toolbar uses icons images that are actually PNG files and uses alpha blending on it. So to make alpha blending work correctly with the Toolbar and the Imagelist I had to use a tricky method with API calls that is described like this by a MS MVP : 1) Use v6 of the common controls (have a manifest) 2) Load the PNG using GDI+
5
7155
by: Jerry Schwartz | last post by:
I've cobbled together a script that should load a picture in a new, automatically sized window. Because the image.height and image.width may be 0 if I test them right away, I use setTimeout to loop until they are both not zero. I've run into two problems: - In IE, the script doesn't seem to loop. If the picture isn't already cached, nothing appears to happen; if it is in cache, the window (rather slowly) opens up. - In Netscape, the...
14
2638
by: charlie_M | last post by:
Is there a way to blank the screen in a FORM's onsubmit=... to blank the screen for the user?? I asked this before and got a way to blank a table by id with "document.getElementById('tabid').style.display='none';" in the onclick event and setting the encapsulating table's ID to 'tabid'. I was wondering if this or some other similar approach that could possibly be planted globally in my pages in the onsubmit validation
3
1447
by: Steven Little | last post by:
I have a button on one screen that opens another form. If I click it then the form opens but the fields are all blank. I look at it in Design view and the filter shows the proper key. If I close the new form and click the button on the 1st form again to open it then this 2nd time the data shows correctly. It is weird as I simply created an edit screen from the table and limit it
2
3464
tdw
by: tdw | last post by:
I have tried to search everywhere for solutions to this. My problem is that on some programs, certain windows are blank white. An example: I installed Adobe Acrobat 8, also Adobe Reader 8. On both, the screen where it asks me to accept or decline the user agreement is blank, so I have no way of accepting. All I can do is click the X (close) button, which then tells me that I have declined the agreement and the program will close. Another...
4
3106
by: sid | last post by:
"about:blank" oepns new browser window I am writing a webpage that will run on other machines that I may or may not know about. My page is framed where frame1 controls the content of frame2. What I have found is that if the page in Frame2 fails to load and I get an error page. when I detect an error page I want to set frame2.location.href = "about:blank" and then write a temp error page until the server becomes available again. The...
0
4592
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi All, i Have an application functionaluty which has 4 forms which are needed to interact by the user by dragging data from these forms to one another the main form is located in the MDI Parent and the rest are on their respective screen (3 other secondry screens) At the moment i am testing using 2 screens but i get a very similar behavious when i run it on a 4 screened system. For the 2 screen system: form1 opens in primary screen (ie...
0
805
by: Jerry Hill | last post by:
On Wed, Oct 1, 2008 at 5:02 PM, Chris Rebert <cvrebert@gmail.comwrote: In particular, you can just rename your script from "myscript.py" to "myscript.pyw". Then when you double click on it, it will be run with pythonw.exe instead of python.exe. -- Jerry
0
9642
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10496
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10538
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9319
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5788
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3077
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.