Hi I'm a definite Newbie for coding (as you'll see in the example below)
I am simply trying to get an output into a Label when certain criteria are met in a form. However, the code below does not work and I can't figure out why:
Option Compare Database
Option Explicit
Private Sub Form_Current()
Dim SFStatus As String
Dim SFStatus1 As String
Dim SFStatus2 As String
Dim SFStatus3 As String
Dim TAStatus As String
Dim TAStatus1 As String
Dim TAStatus2 As String
SFStatus1 = "not assigned"
SFStatus2 = "in progress"
SFStatus3 = "completed"
TAStatus1 = "not assigned"
TAStatus2 = "assigned"
If IsNull(Me.CS_coordinator) Then
SFStatus = SFStatus1
If Not IsNull(Me.CS_coordinator) And Completed = False Then
SFStatus = SFStatus2
If Not IsNull(Me.CS_coordinator) And Completed = True Then
SFStatus = SFStatus3
If IsNull(Me.TA_receipt_date) Then
TAStatus = TAStatus1
If Not IsNull(Me.TA_receipt_date) Then
TAStatus = TAStatus2
End If
End If
End If
End If
End If
lblmessage.caption = "Your File status is" & SFStatus & "and the sample has been" & TAStatus &
End Sub
Please help
Thanks
I am simply trying to get an output into a Label when certain criteria are met in a form. However, the code below does not work and I can't figure out why:
Option Compare Database
Option Explicit
Private Sub Form_Current()
Dim SFStatus As String
Dim SFStatus1 As String
Dim SFStatus2 As String
Dim SFStatus3 As String
Dim TAStatus As String
Dim TAStatus1 As String
Dim TAStatus2 As String
SFStatus1 = "not assigned"
SFStatus2 = "in progress"
SFStatus3 = "completed"
TAStatus1 = "not assigned"
TAStatus2 = "assigned"
If IsNull(Me.CS_coordinator) Then
SFStatus = SFStatus1
If Not IsNull(Me.CS_coordinator) And Completed = False Then
SFStatus = SFStatus2
If Not IsNull(Me.CS_coordinator) And Completed = True Then
SFStatus = SFStatus3
If IsNull(Me.TA_receipt_date) Then
TAStatus = TAStatus1
If Not IsNull(Me.TA_receipt_date) Then
TAStatus = TAStatus2
End If
End If
End If
End If
End If
lblmessage.caption = "Your File status is" & SFStatus & "and the sample has been" & TAStatus &
End Sub
Please help

Thanks