data value in Form field if no table entry

  • Thread starter Pete and Jeannette Smith
  • Start date
P

Pete and Jeannette Smith

I have a form with a field which pulls through and concentenates 2 fields
called [ContactFirstname] and [ContactLastName]from my table

There are however some customers for whom I do not have names and therefore
instead I would like Sir/Madam to appear in the field in the form

I think I have seen this done somewhere using ELSE? but can't find it

Any help/ideas gratefully received
 
A

Allen Browne

Perhaps something like this:
Nz(Trim([ContactFirstname] & " " + [ContactLastName]), "Sir/Madam")
 
P

Pete and Jeannette Smith

Many thanks Allen that works a treat

Pete Smith
Allen Browne said:
Perhaps something like this:
Nz(Trim([ContactFirstname] & " " + [ContactLastName]), "Sir/Madam")

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Pete and Jeannette Smith said:
I have a form with a field which pulls through and concentenates 2 fields
called [ContactFirstname] and [ContactLastName]from my table

There are however some customers for whom I do not have names and
therefore instead I would like Sir/Madam to appear in the field in the
form

I think I have seen this done somewhere using ELSE? but can't find it

Any help/ideas gratefully received
 
J

jeff

Hi guysngals!

not sure on what your doing exactly but maybe look at the following:-

If isnull([ContactFirstname]) then '<-- you may play with this to
determine if only one part is missing ie if you have the surname only etc
ConcatenatedName = "Sir/Madam"
Else
ConcatenatedName = [ContactFirstname] & " " & [ContactLastName]
Endif

cheers
jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top