davidbodhi
Davidbodhi
- Local time
- Today, 12:01
- Joined
- Jul 6, 2005
- Messages
- 79
Hi - I'm very new and totally self-taught = ignorant. Sorry.
I have a table called Contacts that includes the following name fields:
Prefix
First_Name
MI
Last_Name
Suffix
There is also a form called Contacts, where a user can input data on new people. On this form is a field called Full Name that automatically takes the info filled into the above fields and generates a "natural name format" so that the user enters:
Prefix: Dr.
First_Name: Long
MI: J.
Last_Name: Silver
Suffix: phD
and Full Name displays "Dr. Long J. Silver, phD"
To handle situations where some fields may not have data I use the following code of nested IIf's:
IIf(IsNull[Prefix],
IIF(IsNull[MI],
IIf(IsNull[Suffix],
[First_Name]+" "+[Last_Name],
[First_Name]+" "+[Last_Name]+" "+[Suffix]),
IIf(IsNull[Suffix],
[First_Name]+" "+[MI]+" "+[Last_Name],
[First_Name]+" "+[MI]+" "+[Last_Name]+" "+[Suffix]))
,IIF(IsNull[MI],
IIf(IsNull[Suffix],
[Prefix]+" "+[First_Name]+" "+[Last_Name],
[Prefix]+" "+[First_Name]+" "+[Last_Name]+" "+[Suffix]),
IIf(IsNull[Suffix],
[Prefix]+" "+[First_Name]+" "+[MI]+" "+[Last_Name],
[Prefix]+" "+[First_Name]+" "+[MI]+" "+[Last_Name]+" "+[Suffix])))
PROBLEM:
I also have a form called Collected at Time of Visit. On it is a combo box where the user can select a returning Patient, from the table Contacts, to record a new financial transaction. The combo box is working fine, but I want to FORMAT the appearance of the names so they look like the above "Dr. Long J. Silver, phD", rather than showing the columns, as is usual.
I have tried variations on the above code, but get errors, either that I'm referring to fields that don't exist or to objects that don't exist, even when I use the wizard to navigate to the correct fields in the correct table.
Can anyone help me get this to work?
I might as well also mention, the form Contacts also has a pick list Contact_Type that includes Patient, Doctor, Organization, etc as options. I'd like to combo box in question to FILTER so it only displays Patients.
Help with that, too? I'll be very appreciative!
Thanks in advance!
I have a table called Contacts that includes the following name fields:
Prefix
First_Name
MI
Last_Name
Suffix
There is also a form called Contacts, where a user can input data on new people. On this form is a field called Full Name that automatically takes the info filled into the above fields and generates a "natural name format" so that the user enters:
Prefix: Dr.
First_Name: Long
MI: J.
Last_Name: Silver
Suffix: phD
and Full Name displays "Dr. Long J. Silver, phD"
To handle situations where some fields may not have data I use the following code of nested IIf's:
IIf(IsNull[Prefix],
IIF(IsNull[MI],
IIf(IsNull[Suffix],
[First_Name]+" "+[Last_Name],
[First_Name]+" "+[Last_Name]+" "+[Suffix]),
IIf(IsNull[Suffix],
[First_Name]+" "+[MI]+" "+[Last_Name],
[First_Name]+" "+[MI]+" "+[Last_Name]+" "+[Suffix]))
,IIF(IsNull[MI],
IIf(IsNull[Suffix],
[Prefix]+" "+[First_Name]+" "+[Last_Name],
[Prefix]+" "+[First_Name]+" "+[Last_Name]+" "+[Suffix]),
IIf(IsNull[Suffix],
[Prefix]+" "+[First_Name]+" "+[MI]+" "+[Last_Name],
[Prefix]+" "+[First_Name]+" "+[MI]+" "+[Last_Name]+" "+[Suffix])))
PROBLEM:
I also have a form called Collected at Time of Visit. On it is a combo box where the user can select a returning Patient, from the table Contacts, to record a new financial transaction. The combo box is working fine, but I want to FORMAT the appearance of the names so they look like the above "Dr. Long J. Silver, phD", rather than showing the columns, as is usual.
I have tried variations on the above code, but get errors, either that I'm referring to fields that don't exist or to objects that don't exist, even when I use the wizard to navigate to the correct fields in the correct table.
Can anyone help me get this to work?
I might as well also mention, the form Contacts also has a pick list Contact_Type that includes Patient, Doctor, Organization, etc as options. I'd like to combo box in question to FILTER so it only displays Patients.
Help with that, too? I'll be very appreciative!
Thanks in advance!