"
Thanks for the reply Stuart. So THAT's what Echo does!
It ought to work but I'm still getting the blink
Maybe it's something to do with Echo and the Timer not working together.
Private Sub Form_Timer()
Application.Echo False
Me.txtShift.Requery
Application.Echo True
End Sub- Hide quoted text -
Something strange....when I use Dlookup....I have tried several in a
txt box
it comes up blank. I just tried, as you suggested Evi:
=DLookUp("[ShiftName]","ShiftName","TimeValue([StartofShift])<= #" &
TimeValue(Now()) & "# AND TimeValue([EndofShift]) >= #" &
TimeValue(Now()) & "#")
and the box is blank.
When I tried the echo false and my main form disappeared and I could
not retrieve it. I had to close
out the database and re-open even if I commented out the lines of
code.
On what event did you put the Me.txtShiftName.Requery?
Hi Opal
Echo False must be followed by Echo True or it stays switched off.
This code is put in the On Timer Event.
Comment out the On Timer Event for now, until you get the text box working..
It works without the On Timer, it just doesn't update.
In the DLookup, remember to replace my field and table/Query names with
yours.
I see you've got ShiftName as the query or table name which the DLookup is
reading from. Is that what you have called your query or table which holds
the shift times?
The Syntax for DLookUp is
DLookup("[TheFieldinThe OtherTableOrQueryWhich you want to find]", "The
Table Or Query which has that field", "Any Criteria needed for finding that
field")
Make sure that the DLookup is all on one line (the email will almost
certainly break it up).
I've found for the StartOfShift and EndOFShift, it works best if you format
them *in your table* as
hh:nn:ss
You can use a different format in forms and reports but we want the seconds
value in your table
Make sure (if appropriate) that your times follow on from each other,
otherwise your text box will be blank if there is no current shift - which
is what you want.
eg
Shift1 09:00:01 to 12:00:00
Shift2 12:00:01 to 16:00:00
Shift3 16:00:01 to 20:00:00
Have I got the right idea about what you are trying to do?
I've commented out the Echo lines. It seems to make the whole form blink
whereas the Requery event just makes the text box itself blink
Ensure that your Timer Interval in Properties is no less than 5000 so that
it refreshes every 5 seconds. If you don't have to be that precise then have
it refresh less often, say 10000, to cut down on the 'blinks'.
Evi- Hide quoted text -
- Show quoted text -