"IsIconic" Api call not working in 2000

Carl Foster

Registered User.
Local time
Today, 13:57
Joined
May 29, 2006
Messages
72
Hi, I have this code to make Access minimize when a form is minimized.

Code:
If (IsIconic(Me.hWnd) * -1) Then
            
    DoCmd.RunCommand acCmdAppMinimize

It works fine when I run the DB in ver 2003, but in ver 2000, it doesn't work for some reason. Anyone know a fix for this?
 
is it reporting a compile error or just not working. What does the *-1 do - that seems a strange use of code for a boolean.
 
Is (IsIconic) an available function in 2000?
 
To be honest Gemma, I don't understand the code fully. I got it from here

http://www.microsoft.com/office/community/en-us/default.mspx?query=isiconic&dg=&cat=en-us-office-access&lang=en&cr=US&pt=327f343d-f0d6-4e07-aa53-9656edb98ada&catlist=&dglist=&ptlist=&exp=&sloc=en-us

and it works. I use Access 2003, but I converted and sent the file to someone who uses 2000 and it doesn't work on their version of access. I even ran the 2000 version file on my version of Access and it still works, so it must have something to do with the earlier version of the program
 
what did you send them - a whole dbs, or something else?
 
Are they running the same version of Windows as you? Try addind some error handling to the procedure to see if you can catch the error.
 
Yes, he is using XP like me. It will probably be easier if I saw what was happening while it actually runs his computer.:( OH well
 
Sounds like you are using an event handler, such as ‘On Minimize???’, that is not available in Access 2000. Does A2K3 have such an event, I can’t check it at home?

Regards,
Chris.
 
On Resize is available in 97 so one would assume that it's available in a2k, anyway the code works in 97, have you compiled and saved the db?
 
Yes there is a Form_Resize event both in A97 and A2K.

I built a demo in A97 and it worked OK.
Converted it to A2K and it still worked OK.

Both under Windows 2000 Pro.

Maybe if you can post a cut-down A2K version we could have a look at it.

Regards,
Chris.
 
get your friend to check that the references (tools,references in a code window) are the same as yours
 
Thanks for the suggestions. I checked the references and they were the same. I played around with it for a bit and found out something which seems to be a bug in Access 2000:(

If I start the program and run the form straight away, then the m code doesn't seem to work, ie, I select minimize on the form and the code should make the whole of Access minimize to the taskbar.

The strange thing is that if I go into design view first, then run the form from there, when minimizing the form, the whole of Access minimizes just as I want, and maximizes when needed to.

The code I use to minimize is "DoCmd.RunCommand acCmdAppMinimize".I have code to make Access close when the form closes too.This is "DoCmd.Quit" This also doesn't activate in the same way as the minimize one.

This only happens in Access 2000. Surely this is a bug? Unless someone has an explanation.
 

Users who are viewing this thread

Back
Top Bottom