none
Help With Form Timer Property

    Question

  • I have a form (frmbo) that I want the rel field to change from key ID 12 to 13 based on the timer property, when the TimeInterval = 900000 milliseconds using the code below.

     

    If Release date < Now () then Rel = 13

     

    The problem I am having is that the change only occurs when the rel has focus.  How do I go about making the form or field change it automatically without the field(s) having focus?



    • Edited by ForGod Tuesday, April 26, 2011 10:45 AM
    Monday, April 25, 2011 3:08 PM

Answers

  • Hi again,

    It should work, you might try to Refresh your Form, so the current records in your Form are refreshed after the change.

     

    Add below line to your code

    Me.Refresh

     

    Private Sub Form_Timer()

    If Me.[Release date] < Date() Then

    Me.Rel = 13

    Me.Refresh

     End Sub

     

    HTH,

    Daniel

    • Marked as answer by ForGod Tuesday, April 26, 2011 4:17 PM
    Tuesday, April 26, 2011 3:57 PM

All replies

  • You can try to use the TimerEvent on the Form to do this;

    Private Sub Form_Open(Cancel As Integer)
    Me.TimerInterval = 900000
    End Sub

    Private Sub Form_Timer()

    If Me.[Release date] < Date() Then

    Me.Rel = 13

    End Sub

     

    HTH,

    Daniel

    • Marked as answer by ForGod Monday, April 25, 2011 7:54 PM
    • Unmarked as answer by ForGod Tuesday, April 26, 2011 10:44 AM
    Monday, April 25, 2011 3:30 PM
  • I am still having problem using the TimerEvent.   The change only occurs if the rel field has focus.  Does anyone know how this can be done without the rel field having focus?

     

    Thanks

    Tuesday, April 26, 2011 10:54 AM
  • Hi again,

    It should work, you might try to Refresh your Form, so the current records in your Form are refreshed after the change.

     

    Add below line to your code

    Me.Refresh

     

    Private Sub Form_Timer()

    If Me.[Release date] < Date() Then

    Me.Rel = 13

    Me.Refresh

     End Sub

     

    HTH,

    Daniel

    • Marked as answer by ForGod Tuesday, April 26, 2011 4:17 PM
    Tuesday, April 26, 2011 3:57 PM
  • Thanks, It worked!  I did not even think about refreshing the form.  Thanks
    Tuesday, April 26, 2011 4:18 PM