I copied your code into a module and put this code in a form. When it ran the message box displayed the value of wave as true. It worked fine, It might be in the rest of your code where the error occurs.

Private Sub Command1_Click()
Dim wave As Boolean
wave = False
If SayHi(wave) = True Then
MsgBox wave
End If
End Sub