Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change textbox word problem 1

Status
Not open for further replies.

kupe

Technical User
Sep 23, 2002
376
0
0
If the field, LastJobEndDate, is more than 28 days old, a message should appear in field DailyGrind 'Available'.

For some unknown reason, this sub won't change the message. H e l p, please Experts.

Private Sub Form_Current()

If Abs(DateDiff("d", LastJobEndDate, Date)) >= 28 Then
Forms!frmMatrix.frmWorkers.Form!DailyGrind = "Available"

End If

End Sub
 
Is the DailyGrind field bound to a table field? If not, try:
Code:
Private Sub Form_Current()

    If Abs(DateDiff("d", LastJobEndDate, Date)) >= 28 Then
        Forms!frmMatrix.frmWorkers.Form!DailyGrind = "Available"
    Else
        Forms!frmMatrix.frmWorkers.Form!DailyGrind = vbNullString      
    End If

End Sub

[pc2]
 
Looks a great improvement on mine. Thank you very much, mp9. Cheers
 
You may even use this simpler condition:
If LastJobEndDate <= Date - 28 Then

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top