NZ function A 2013

Dick7Access

Dick S
Local time
Today, 15:43
Joined
Jun 9, 2009
Messages
4,325
I can't find my notes from last time someone here instructed me on the NZ function. Sorry I have to ask again. This function works well as long as everybody has a first name. However, doesn't when first name is null.

I tried this code but it's not correct.

Code:
strCombN = Nz(Me.txtNameF) & (" and " + Me.txtSpouce)    'combines husband and wife first name over picture
Code:
Function CombFandS()

Dim strCombN As String

                  
If IsNull(txtNameL) Then
  MsgBox "You have already reached the Last person.", vbApplicationModal, "Remember God does Knee Mail"
Else
 strCombN = Me.txtNameF & (" and " + Me.txtSpouce)    'combines husband and wife first name over picture
 combName = strCombN
 
 End If
 End Function
 
and " + Me.txtSpouce
and " & Me.txtspouce ' spouse ?
The + can error with a string. for example 6 + null = null "hi" + null = null 6 & Null = 6 "hi" & Null = Hi

I have to catch the train, try that out.
 
srtComboN = Nz(Me.txtNameF,"") & " And " & nz(Me.txtSpouse,"")

Dale
 
srtComboN = Nz(Me.txtNameF,"") & " And " & nz(Me.txtSpouse,"")

Dale
Thanks! Just like down town! works great.
This is what I ended up with.
Code:
strCombN = Nz(Me.txtNameF, "") & (" and " + Me.txtSpouce) 'combines husband and wife first name over picture
 

Users who are viewing this thread

Back
Top Bottom