sharonniles
Programmer
Good Afternoon,
I'm filling in a Word document using Access XP. To fill in each line I'm using for example:
objWord.Selection.TypeText Text:=Me![First Name] & " " & Me![Last Name]
Let's say the first name field is null, how can I put an IF statement to change the first name field to "Mr.".
I tried:
if objWord.Selection.TypeText Text:=Me![First Name] is null then
objWord.Selection.TypeText Text:="Mr." & Me![Last Name]
else
objWord.Selection.TypeText Text:=Me![First Name] & " " & Me![Last Name]
end if
Obviously this is wrong. What is the correct syntax?
Thanks
I'm filling in a Word document using Access XP. To fill in each line I'm using for example:
objWord.Selection.TypeText Text:=Me![First Name] & " " & Me![Last Name]
Let's say the first name field is null, how can I put an IF statement to change the first name field to "Mr.".
I tried:
if objWord.Selection.TypeText Text:=Me![First Name] is null then
objWord.Selection.TypeText Text:="Mr." & Me![Last Name]
else
objWord.Selection.TypeText Text:=Me![First Name] & " " & Me![Last Name]
end if
Obviously this is wrong. What is the correct syntax?
Thanks