Hi i'm new into access and i just start it recently and i dont know how to finih my if statment and i had been searching for the code from youtube still cant find it. Please help to find it.
I have a table called BlockPlace and there're only 2 fields Block and Status
and this's code that i use to change color in the from_load
If [Block] = 1 And [Status] = "AVAILABLE" Then
Label1.ForeColor = vbGreen
ElseIf [Block].Value = 1 And [Status] = "OCCUPIED" Then
Label1.ForeColor = vbRed
End If
this code is working properly but this one
If [Block] = 2 And [Status] = "AVAILABLE" Then
Label2.ForeColor = vbGreen
ElseIf [Block].Value = 2 And [Status] = "OCCUPIED" Then
Label2.ForeColor = vbRed
End If
is not working for number 2
so basically i just want get the label font color to green and red it's simple but the source is from the table and i dont know how to use it, can someone tell me what i must i change for [block] to get the right record
thanks ~
I have a table called BlockPlace and there're only 2 fields Block and Status
and this's code that i use to change color in the from_load
If [Block] = 1 And [Status] = "AVAILABLE" Then
Label1.ForeColor = vbGreen
ElseIf [Block].Value = 1 And [Status] = "OCCUPIED" Then
Label1.ForeColor = vbRed
End If
this code is working properly but this one
If [Block] = 2 And [Status] = "AVAILABLE" Then
Label2.ForeColor = vbGreen
ElseIf [Block].Value = 2 And [Status] = "OCCUPIED" Then
Label2.ForeColor = vbRed
End If
is not working for number 2
so basically i just want get the label font color to green and red it's simple but the source is from the table and i dont know how to use it, can someone tell me what i must i change for [block] to get the right record
thanks ~