dream
09-04-2003, 12:13 AM
Hi,
I wanna do a text box that whenever you update the data it'll show the last date of the data that u key in. Can this be done?
Basically on whatever event you want to use to detect the update on the text box, you would push the current date to a text box bound to a field to store it. Do not allow updates on this text box containing the date by the users.
dream
09-04-2003, 06:20 PM
! more thing is can it be done in this way like morning before 12pm when people login to the database and it prompt up a msgbox "Good Morning" then after 12pm login people it'll prompt "Good Afternoon" and so on... Can it be done?
WayneRyan
09-04-2003, 10:37 PM
dream,
On a form's OnOpen event, you can put:
If InStr(1, Now(), "PM") > 0 Then
MsgBox ("Good afternoon")
Else
MsgBox("Good Morning")
End If
Wayne
dream
09-04-2003, 10:47 PM
Wayne,
I've written a code but it seen work to be can you check for me is this correct?
code:
__________________________________________________
Private Sub Form_Load()
If Text51.Value >= "12:00 AM" Then
MsgBox "Good Morning!!", vbOKOnly, "Welcome"
ElseIf Text51.Value <= "12:00 PM" Then
MsgBox "Good Afternoon!!", vbOKOnly, "Welcome"
ElseIf Text51.Value >= "6:00 PM" Then
MsgBox "Good Evening!!", vbOKOnly, "Welcome"
End If
End Sub
__________________________________________________
WayneRyan
09-04-2003, 11:03 PM
dream,
That won't do, you are comparing strings.
If Time() > TimeSerial(18, 0, 0) Then
MsgBox("Good Evening")
ElseIf Time() > TimeSerial(12, 0, 0) Then
MsgBox("Good Afternoon")
Else
MsgBox("Good Morning")
End If
Wayne
dream
09-04-2003, 11:33 PM
Wayne,
Ok then i've to change the code... Thanks alot!!