From: Bre-x on 27 May 2010 10:07 Hi, Why this function is not working? If a time follows between 12AM and 3PM it should show Day shift, anything else Night Shift If Time > #12:01:00 AM# < #3:00:00 PM# Then MsgBox "DAY SHIFT" Else MsgBox "NIGTH SHIFT" End If
From: John Spencer on 27 May 2010 10:53 If Time > #12:01:00 AM# AND Time < #3:00:00 PM# Then MsgBox "DAY SHIFT" Else MsgBox "NIGTH SHIFT" End If Note that you need to repeat the entire comparison. John Spencer Access MVP 2002-2005, 2007-2010 The Hilltop Institute University of Maryland Baltimore County Bre-x wrote: > Hi, > > Why this function is not working? > > If a time follows between 12AM and 3PM it should show Day shift, anything > else Night Shift > > If Time > #12:01:00 AM# < #3:00:00 PM# Then > MsgBox "DAY SHIFT" > Else > MsgBox "NIGTH SHIFT" > End If > >
From: Steve on 27 May 2010 10:58 Several things ....... 1. Time is an Access function and returns the current system time. 2. If Time is a field, you need to change the name to something else. 3. If Time > #12:01:00 AM# < #3:00:00 PM# Then should be: If Time > #12:01:00 AM# And Time < #3:00:00 PM# Then 4. "NIGTH SHIFT" is mispelled. Should be "Night Shift" Steve santus(a)penn.com "Bre-x" <cholotron(a)hotmail.com> wrote in message news:OKSenXa$KHA.5292(a)TK2MSFTNGP06.phx.gbl... > Hi, > > Why this function is not working? > > If a time follows between 12AM and 3PM it should show Day shift, anything > else Night Shift > > If Time > #12:01:00 AM# < #3:00:00 PM# Then > MsgBox "DAY SHIFT" > Else > MsgBox "NIGTH SHIFT" > End If > >
From: Bre-x on 27 May 2010 11:03 Thank you both!!! Bre-x "Bre-x" <cholotron(a)hotmail.com> wrote in message news:OKSenXa$KHA.5292(a)TK2MSFTNGP06.phx.gbl... > Hi, > > Why this function is not working? > > If a time follows between 12AM and 3PM it should show Day shift, anything > else Night Shift > > If Time > #12:01:00 AM# < #3:00:00 PM# Then > MsgBox "DAY SHIFT" > Else > MsgBox "NIGTH SHIFT" > End If > >
|
Pages: 1 Prev: totals do not display unless user clicks on text box Next: Linking Excel Files in Access |