Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / May 2005

Tip: Looking for answers? Try searching our database.

Timer intervall to set form invisible

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gina - 05 May 2005 16:41 GMT
Hi.

I am trying to set my main form (frmMain) to be invisible after a certain
time and the start-up form (frmStart) where a user input is required should
come up - lets say after 5 minutes of nothing happening..., maybe

I 've set the timer interval to 50000 in the Form_Current event of frmMain
.... but now I don't know how to go on.
after correct input the frmMain is opened and frmStart is invisible ...
maybe I should just use the screen saver .... but I wonder how this would be
carried out in a programme !!??
I would very grateful for help and idea(s) ? !!

Thanks,
Gina
jl5000 - 05 May 2005 19:38 GMT
The timer doesn't stop whether there is activity or not,

The Five minutes should be set in the Timer Interval property of the form,
five minutes will be represented with 300000,

You can do this:

On the on open and after update events of each form set the timer interval
of the main form to 0 and then back to 300000:

Private Sub Form_Open(Cancel As Integer)
   Forms("MyForm").TimerInterval = 0
   Forms("MyForm").TimerInterval = 300000
End Sub

On the ontimer event of the main form add this code:

Private Sub Form_Timer()
   If Me.Visible Then
       Me.Visible = False
       Docmd.OpenForm "frmStart"
   End If
End Sub

then have the form frmStart make the Form frmMain visible after the action
you expect from the user,

Forms!MainForm!Timer=0

Signature

jl5000
<a href="http://joshdev.com"></a>

> Hi.
>
[quoted text clipped - 11 lines]
> Thanks,
> Gina
Gina - 05 May 2005 19:47 GMT
Thank you  .... jl5000

I was thinking about what is inactivity ... no mouse move, no clicks but
didn't get any further
as the timer went on and on ....
.... but your suggestion now sounds as if its the solution to my problem !!!

thanks again
Gina

> The timer doesn't stop whether there is activity or not,
>
[quoted text clipped - 40 lines]
> > Thanks,
> > Gina
Gina - 06 May 2005 10:39 GMT
Hi jl5000,

I have been playing around with your idea & code
I have the setback to TimerInterval = 0 and setItAgain to TimerInterval =
120000 (just to test) in the main forms Form_Click, Form_AfterUpdate,
Form_MouseMove events

   Forms("frmMain").TimerInterval = 0
   Forms("frmMain").TimerInterval = 120000

further I put the above code into each of the 3 subforms events like above
I put a halt on the lines in the events .... they do not fire... :(
I do not know when those events fire at all !!!
Is there a way to ask whether any control of main and subforms has got some
events - if so and then do something within the time set by the timer
events like click, keypress, mousemove .... without having to type it in
each single control - oh dear ;-)

users may open it and just read some info and click around on the controls -
searching, retrieving etc without adding, editing or deleting records ....
so the form may not get updated at all ??!!
to make a long story short - it still doesn't set back the timer ....

This is in the frmMain's Timer event:
   If Me.Visible Then
       Form_frmStart.Visible = True
       Form_frmStart.txtUserName.SetFocus
       Me.Visible = False
   End If

Think I can't use it this way .... the user will have to type in the
password each time the timer has finished ... despite someone is working
with the programme..., oh please ... I would thrtough such a programme into
the bin!!
so is there any other way ..... ???

any help, ideas or links highly appreciated !!

Thanks,
Gina

> The timer doesn't stop whether there is activity or not,
>
[quoted text clipped - 40 lines]
> > Thanks,
> > Gina
jl5000 - 06 May 2005 18:01 GMT
For subforms try the On Enter event,

also

-You can create a function with the code in a generic module

Function Check_Activity_Timer()
    Forms("frmMain").TimerInterval = 0
    Forms("frmMain").TimerInterval = 120000
End Function

-create a macro with action runcode, Check_Activity_Timer
-Call that macro in the on open events on forms and on Enter event in
subforms, so you do not have to copy the code to every form,

Signature

jl5000
<a href="http://joshdev.com"></a>

> Hi jl5000,
>
[quoted text clipped - 85 lines]
> > > Thanks,
> > > Gina
Gina - 08 May 2005 10:02 GMT
jl5000,

I created the macro .... could not find an onenter event for forms (or
subforms)
so I changed the function to refresh the main form after each timerInterval
setting ....

put it as before in all the form events (I thought or hoped get called at
some point in time !!! - well ... obviously not)

so now ... as it worked fine with the picture .... i created a picture
filled with the forms background just a few pixels in width and height ....

inserted this tiny picture into a picframe and on load: picture.width =
form.insidewidth .. the height I have to size in design view

I am calling the function below on click and mousemove of each forms picture
.....unbelievable: it works ....

> Function Check_Activity_Timer()
>      Forms("frmMain").TimerInterval = 0
>      Forms("frmMain").TimerInterval = 120000
> End Function

downside of it:
1. it's only a trick (and therefore not really satisfying)
2. I have to cut all the controls of each subform, insert the pic, paste the
controls again .... (there must be sth. wrong with access ... if it doesn't
react on Form_Click and Form_MouseMove etc

On the other hand I am glad it somehow works at all

Big Thanks jl5000 for your hands-on help

Gina

> For subforms try the On Enter event,
>
[quoted text clipped - 100 lines]
> > > > Thanks,
> > > > Gina
jl5000 - 06 May 2005 18:04 GMT
Try this function as described in my prev post

Function Check_Activity()
      Forms("frmMain").TimerInterval = 0
      Forms("frmMain").refresh
      Forms("frmMain").TimerInterval = 120000
      Forms("frmMain").refresh
End Function
Signature

jl5000
<a href="http://joshdev.com"></a>

> Hi jl5000,
>
[quoted text clipped - 85 lines]
> > > Thanks,
> > > Gina
Gina - 07 May 2005 10:31 GMT
Thanks jl5000

will try what you suggested ..... I just tried to use a picture as
background ... so I cut all the controls of a test form inserted the picture
pasted the controls and used the mousemove and click events of the picture
..... so the timer as you first suggested works !!!!

what I do not understand is why the events of the frmMain (the one without
picture) Form_Click, Form_MouseMove do not fire ..... am I doing something
wrong or am I thinking wrong ???

Thanks again,
Gina
> Try this function as described in my prev post
>
[quoted text clipped - 94 lines]
> > > > Thanks,
> > > > Gina
Gina - 09 May 2005 16:53 GMT
Hi jl5000

just wanted to complete how I am getting on re the above
found out that using the parts of a form (head, detail and foot) and assign
your function to click and mousemove evnets of each main and subform (parts)
works .....
deary me .... finally ... without a trick!!!

Thank you!!

Gina

> Try this function as described in my prev post
>
[quoted text clipped - 94 lines]
> > > > Thanks,
> > > > Gina
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.