timer event (1 Viewer)

uji_amira

New member
Local time
Tomorrow, 02:10
Joined
May 15, 2007
Messages
6
I have 1 form that 1 want to refresh the subform based on certain interval.
I have set at the form open procedure to set the time interval as 1 second
Me.TimerInterval = 1000
I have also set at the form properties the timer interval as 1000 .
In the ontimer event procedure, I hv copied the exact code as in execute button. It should execute the same task as when I click the execute button (which is working), but however, does not in the ontimer event procedure .

Private Sub Form_Timer()
'same command as in execute button
end sub
I hv to click the execute button to refresh the data for the subform.

If checkdata.Value = True Then
Me!Frm2_View.Form.RecordSource = "Select * from table_a where
table_a.DateTime_Start >= [forms]![Form1]![txtstartdate]; "
end if
The code above is just an example, mine is a bit longer, but almost similar. however, the txtstartdate fields and the rest are all filled up when I wait for the timer interval to execute .

Did I miss anything?
Appreciate the feedbacks..
thanks
 
Last edited:

boblarson

Smeghead
Local time
Today, 11:10
Joined
Jan 12, 2001
Messages
32,059
Did you set the enable property to YES, either in the form's properties or via code?
 

uji_amira

New member
Local time
Tomorrow, 02:10
Joined
May 15, 2007
Messages
6
enable property to YES?

Where should I set it? I hv already set the number as 1000 in the form properties for timer interval.
 

boblarson

Smeghead
Local time
Today, 11:10
Joined
Jan 12, 2001
Messages
32,059
Sorry, I was thinking VB6 and not Access VBA when I said that.

One thing, are you really sure you need to do that checking so frequently? Looking at the code that is included, it looks like it would take longer than a second to complete. I would start your testing at no less than 10 seconds (10000). You can back it down little by little if that doesn't work for you. But, using a timer set at one second like that is just asking to lock the computer's resources up and not let anything else run.
 

uji_amira

New member
Local time
Tomorrow, 02:10
Joined
May 15, 2007
Messages
6
I hv already set it to 10 seconds, but still to no avail..
I set the properties and the timer procedure (2 place).

Did I forgot to add anything else?
 

Users who are viewing this thread

Top Bottom