Forms / Subforms and Timing Event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that has many subforms that an be displayed. If no data is
entered on the subform in a specificed amount of time (timeout) I want to
close the subform (from inside the sub form) and redisplay a default screen
(login screen).

The timer event is working properly, but I cant get the subform to close.

I would appreciate any help that anyone could offer.

Thanks in advance
 
Hi,


Consider to specify the subform CONTROL source object to nothing:


Set Me.SubFormControlName.SourceObject = Nothing

in the main form (or assign it to an "empty" , or "default" form).




Hoping it may help,
Vanderghast, Access MVP
 
Michel

Thank you for your reply

Let me see if I can explaing a little better, what I am trying to do

The main form of the application can call multiple sub forms (currently 33).
I am controlling the process through the use of a LIFO queue ... which works
fine. I want to be able to time out a sub form when no input is entered for
1 minute. I put a Timer event into a subform and specified the timer
interval to by 60000 ( 1 minute). I also put into the onchange event for
each input field code to set the timerinterval property to 0 and then to
60000. The timer interval seems to work fine.

I cant seem to close the subform and give control to the main form using the
Timer Event. The subform hangs up in transfering control.

I tried to RAISEEVENT to a DONE control that is used when the data has beed
entered, but it did not work. I also cleared my LIFO queue which triggers
the loading of the login screen (which works), the queue clears, but the
subform will not close and transfer back to the main form

Any help would be appreciated

George

Michel Walsh said:
Hi,


Consider to specify the subform CONTROL source object to nothing:


Set Me.SubFormControlName.SourceObject = Nothing

in the main form (or assign it to an "empty" , or "default" form).




Hoping it may help,
Vanderghast, Access MVP
 
Hi,


I have two subforms, SF1 and SF2 each one made of a single label (with SF!
and SF2 as text) and the following code:


=============
Option Compare Database
Option Explicit

Private Sub Form_Timer()
Call Forms(Me.Parent.Name).TimerFired
End Sub
=============


Their timer interval is set to 5000 (5 sec).


The main form, SFS, has just one subform control, initially set to SF1. The
whole code under SFS is:


================
Option Compare Database
Option Explicit

Public Function TimerFired()
If Me.Child0.SourceObject = "SF1" Then
Me.Child0.SourceObject = "SF2"
Else
DoCmd.Close acForm, "SFS"
End If

End Function
=================



Having saved everyone, if I start displaying SFS, after 5 sec, its subform
changes to SF2, and 5 more seconds later, the form close. Note that I do not
close the sub-form, I just change them (through the SourceObject property)
of the control "bound" to them.




Hoping it may help,
Vanderghast, Access MVP



George H. Slamowitz said:
Michel

Thank you for your reply

Let me see if I can explaing a little better, what I am trying to do

The main form of the application can call multiple sub forms (currently
33).
I am controlling the process through the use of a LIFO queue ... which
works
fine. I want to be able to time out a sub form when no input is entered
for
1 minute. I put a Timer event into a subform and specified the timer
interval to by 60000 ( 1 minute). I also put into the onchange event for
each input field code to set the timerinterval property to 0 and then to
60000. The timer interval seems to work fine.

I cant seem to close the subform and give control to the main form using
the
Timer Event. The subform hangs up in transfering control.

I tried to RAISEEVENT to a DONE control that is used when the data has
beed
entered, but it did not work. I also cleared my LIFO queue which triggers
the loading of the login screen (which works), the queue clears, but the
subform will not close and transfer back to the main form

Any help would be appreciated

George
 
Back
Top