Can you check this small code

hyousef

Registered User.
Local time
Today, 18:57
Joined
Jan 15, 2002
Messages
41
I have a textbox (txtEnddate) and another textbox (notebox), i want if txtEnddate is empty then display a message in notebox.

Is there any wrong with the following code:
Because it doesn't return any error but it doesn't do anything.

If IsNull(Me![txtEndDate]) Then
Me.notebox.BackColor = 14803425
Me.notebox = "do something"
End If
 
on form's current event.
 
"The Current event occurs when the focus moves to a record, making it the current record, or when the form is refreshed or requeried."

Your code is not being triggered. Try the forms Before Update event or the command button that moves you to another record....
 
If you're trying to make sure they enter an endDate, make the field Required.

David R
 
The EndDate can be empty and when its empty i want a message to appear in notebox.

Here is the whole code

Dim ExpDate As Integer

ExpDate = DateDiff("d", Date, Me.[txtPlannedEndDate])
If ExpDate <= 14 And ExpDate >= 0 Then 'And Me!txtStatus <> 100 Then
Me.notebox.BackColor = 0
Me.notebox = "Better Hurry !!! This Activity has " & Str(ExpDate) & " days until the Planned end date."


ElseIf ExpDate < 0 Then 'And Me!txtStatus <> 100 Then
Me.notebox.BackColor = vbRed
Me.notebox = "This Activity is overdue !!!"


ElseIf ExpDate > 14 Then 'And Me!txtStatus <> 100 Then
Me.notebox.BackColor = vbBlue
Me.notebox = "This Activity has " & Str(ExpDate) & " days until the Planned end date."


ElseIf IsNull(Me![txtActualEndDate]) Then
Me.notebox.BackColor = 14803425
Me.notebox = "Do Something"

End If


My code is working but the last part. I mean it gives messages for the rest conditions but it doesn't recognize the last part.
 
Sorry guys, i confused you...forget about the previous code.
What i want is to say if txtEndDate is not empty then "this job was completed"

ElseIf IsNull(Me![txtActualEndDate]) Then
Me.notebox.BackColor = 14803425
Me.notebox = "Do Something"

I tried IsNotNull but it didn't work
 

Users who are viewing this thread

Back
Top Bottom