case statement

S

souris

Does MS Access support case or if statement?
I would like to have my value depends on other field.

Any sample code would be great appreciated,

Souris,
 
M

Mark

Public Function WhatToDo (strUserInput as String) as String
Select Case strUserInput
Case "Whine"
WhatToDo = "Would you like some cheese with that whine?"
Case "Complain", "Threaten"
WhatToDo = "Sorry, not my department."
Case Else
WhatToDo = "Sorry, can't help you."
End Select
End Function

"souris" wrote ...
 
Top