Link to home
Start Free TrialLog in
Avatar of judgebeddie
judgebeddie

asked on

Now() type mismatch

I always get a type mismatch error when comparing the current time Now() to a date/time field. I want to have the text box border flash when the current time has passes the "Alarm" time. I can't even get the current time to be copied into a date/time field for testing.

Sample code:
Private Sub test_button_Click()
    Let Now() = Me.CDAsAlarm
    If Now() > Me.CDAsAlarm Then  
        With Me.CDAsTime
            .BorderColor = (IIf(.BorderColor = vbBlue, vbRed, vbBlue))
        End With
    End If    
End Sub

Open in new window

SOLUTION
Avatar of danishani
danishani
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of judgebeddie
judgebeddie

ASKER

I was abel to use MX solution; but Daniel gave good pointers...thanks! I still have to work out a timing issue, but thats a different problem.