Hello to all,

I want to capitalize the first letter of every word. The problem is if some fields are null, it fails.

example
VB Code:
  1. Private Sub Name()
  2. Dim strFullName As String
  3.  
  4. strFullName = IIf(Not IsNull(rstLast).Value, Cap(Trim(rstLast).Value, "") _
  5.               & ", " & IIf(Not IsNull(rstFirst).Value), _
  6.               Cap(Trim(rstFirst).Value), "") _
  7.               & " - " & IIf(Not IsNull(rstTitle).Value, _
  8.               Cap(Trim(rstTitle).Value), "")
  9.  
  10. End Sub
thanks