Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Activate program that's been minimized...

Status
Not open for further replies.

snayjay

Programmer
Oct 23, 2001
116
US
I had written a long explanation but decided to rewrite it... here's the skinny. I have a client side database that scans the table for new entries. When it sees one it updates a listbox. The code is placed in the On_Timer event and cycles every second.

I want the form to popup on the screen over what anyone is working on (basically from minimized in the taskbar) whenever the count >= 1.

My code is:

Code:
dim x
x = dcount("[VISITID]","VISITORtbl","[SEEN] = -1"
if x >= 1 then
   me.setfocus
end if

Obviously it's the me.setfocus that isn't making the form popup over what the users are working on. Does anyone know how to code it differently? Any help would be greatly appreciated.

~Snay
 
Perhaps this ?
DoCmd.SelectObject acForm, Me.Name
DoCmd.Restore

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV, thanks alot for responding. I've never used docmd.restore... hope it works. I don't have the ability to do client/server at home... so I'll try it first thing tomorrow. I'll update this thread then...thanks again!

~Snay
 
Ok, I'm at work and I've tried it... got this:

Run-Time Error '2465'

Here is the code:

Code:
    Dim x
    x = DCount("[VISITID]", "VISITORtbl", "[SEEN] = -1")
    If x >= 1 Then
        Forms!CSfrm.Restore
    End If

Any clue?

~Snay
 
Ok... sorry about that, didn't put the code in as you instructed. But I caught my error at least. I retried your code and although I didn't get an error... it didn't work. No popup action.

Code:
    Dim x
    x = DCount("[VISITID]", "VISITORtbl", "[SEEN] = -1")
    If x >= 1 Then
        DoCmd.SelectObject acForm, "CSfrm"
        DoCmd.Restore
    End If

Any clue?

~Snay
 
Just a *Bump*...wanna see if anyone else has an answer for this. Still not working.

~Snay
 
Another Bump... still can't get it to work. Any more work arounds?

~Snay
 
Ok... figured it out, found it searching more threads.

AppActivate myApp

will bring to focus any application you have open. Now to find the thread again where I found it and give him a Star!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top