Populate a textbox based on others within the form being null or filled

ecco

New member
Local time
Today, 09:29
Joined
May 21, 2013
Messages
7
Hi,
I am fairly new to Access and trying to populate a text box based on whether other textboxes throughout the form contain a date or are null, so as I update the progress of work the textbox that I have located in the header will indicate the status of work flow, this is what I thought might work but I seem to be doing something wrong. Appreciate any help!

Code:
Private Sub Form_AfterUpdate()
    Status = IIf([Date_Raised] Is Null, "New", "")
    Status = IIf([Date_Raised] Is Not Null, "Open", "")
    Status = IIf([Approved_Date] Is Not Null, "Approved", "")
    Status = IIf([Actioned_Date] Is Not Null, "Actioned", "")
    Status = IIf([Tested_Date] Is Not Null, "Tested", "")
    Status = IIf([Closed_Date] Is Not Null, "Closed", "")
End Sub
 
Welcome to the forum.

The After Update Event does not fire until you move to another record. So if you want the status to change as the records are altered you might try using each of the field's On Change event.

Also you code should look like;
Code:
If IsNull(Me.Date_Raised) then
     Me.Status = "New"
Else
     Me.Status = "Open"
End If
 
Thanks John, worked a treat.
 

Users who are viewing this thread

Back
Top Bottom