Cancel timer event after one instance

BarryMK

4 strings are enough
Local time
Today, 16:30
Joined
Oct 15, 2002
Messages
1,350
I think this is probably a stupid question and the answer is no but here goes anyway.

On opening a form a timer event sets the focus to a particular field, which in turn updates some other fields. At this point is it possible to disable the timer event so it does not repeat the process?
 
Try the following:

Put:
Dim t as long
in the declarations section at the top of your form.


In the On Load event, put: t = 0


In the On Timer event put:
If t = 0 then
'Your code here
t = 1
End If


HTH

Dave
 
Dave your code is as outstanding as your avatar! :D
 
An even simpler coding would be:

in the timer event put:

Code:
   ...put your code you want to run here
   Me.Timer.Interval = 0
 
Bob haven't tried yours yet, but thanks. I do have another problem that's been exercising my mind for a few hours. I think I've read everything about filtering from combos and listboxes but I just can't get this one solved and I've been through many variations of code. Again it's got to be simple but I can't see it.

I've attached a small example dbase to illustrate my quandary.

I just want to select a ServiceName from the listbox on frmSelect and open frmRecords with only the records in the table with that ServiceName.

I just can't find the right syntax to pass the variable from my listbox to the form.
 

Attachments

Your problem is twofold.

1. The reference to your listbox control in Query1 is not correct. The name of the listbox is listed as lstSel instead of it's actual name of lstSelect.

2. Change the bound column of your listbox to column 2 in the properties.
 

Attachments

Bob Thanks I knew it was something dopey. I had found the lstSel glitch and I thought I'd tried binding to different columns but obviously I wasn't on the ball there. Sometimes it's so near yet so far. Thanks again. :)
 

Users who are viewing this thread

Back
Top Bottom