Hey everybody,
I have the working code (well it seems to work, debugged fine etc). However, I have to make a command button on a form with plant details (which I did) and in the event properties I selected 'on click' and went to the code builder and put in the code.
However, when I click the button nothing executes i.e. a message is meant to appear depending on the code I have made:
Function stradvice(strcolour) As String
If IsNull(strcolour) Then
stradvice = ""
Exit Function
End If
Select Case strcolour
Case "white"
stradvice = "Goes well with red"
Case "brown"
stradvice = "Goes well with purple"
Case "green"
stradvice = "Best not to mix colours"
Case "orange"
stradvice = "Put in a dark pot"
Case "red"
stradvice = "Looks better in a dark room"
Case Else 'none of the above
stradvice = "Mix with other species for an exotic look"
End Select
End Function
I am just wondering if anybody knows how to successfully implement this so when the command button is clicked it brings up the correct message.
I have the working code (well it seems to work, debugged fine etc). However, I have to make a command button on a form with plant details (which I did) and in the event properties I selected 'on click' and went to the code builder and put in the code.
However, when I click the button nothing executes i.e. a message is meant to appear depending on the code I have made:
Function stradvice(strcolour) As String
If IsNull(strcolour) Then
stradvice = ""
Exit Function
End If
Select Case strcolour
Case "white"
stradvice = "Goes well with red"
Case "brown"
stradvice = "Goes well with purple"
Case "green"
stradvice = "Best not to mix colours"
Case "orange"
stradvice = "Put in a dark pot"
Case "red"
stradvice = "Looks better in a dark room"
Case Else 'none of the above
stradvice = "Mix with other species for an exotic look"
End Select
End Function
I am just wondering if anybody knows how to successfully implement this so when the command button is clicked it brings up the correct message.