V
vanlanjl
Okay I have a form that has a combo box on it titled "cmbSearchForUser"
CODE
Row Source:
SELECT [Query1].[Last Name], [Query1].[First Name], [Query1].[Initial] FROM
Query1;
CODE
Row source type: table/query
bound coulmn:1
limit to list:yes
allow value list edits:yes
inherit value list:yes
show only row source values:no
enabled:yes
locked:no
auto expand:yes
Here's my problem, the way it is set up now when i select a name in the
list, a.) it only shows the last name ( this is a problem because there are
multiple users with same last name, in fact i have some users that have the
same last name and first name, so i added the Initial field in the
tblContacts ), when i click the last name it is showing it will populate the
txt boxes on the form.
No i have tried to change the combo box so it would show the last name,
first name and middle initial.
What i did was in row source i took out the above sql statement and selected
Query1. (code follows)
And it worked, kind of, it did show the last name first name and middle
initial, but when selected it would no longer populate the txt boxes in the
form, it would set it to a new record. Any ideas what I am doing wrong here?
Any help appreciated.
CODE
SELECT IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First
Name]),IIf(IsNull([First Name]),[Last Name],[Last Name] & ", " & [First
Name])) AS [File As], IIf(IsNull([Last Name]),IIf(IsNull([First
Name]),[Company],[First Name]),IIf(IsNull([First Name]),[Last Name],[First
Name] & " " & [Last Name])) AS [Contact Name], tblContacts.*
FROM tblContacts
ORDER BY IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First
Name]),IIf(IsNull([First Name]),[Last Name],[Last Name] & ", " & [First
Name])), IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First
Name]),IIf(IsNull([First Name]),[Last Name],[First Name] & " " & [Last
Name]));
CODE
Row Source:
SELECT [Query1].[Last Name], [Query1].[First Name], [Query1].[Initial] FROM
Query1;
CODE
Row source type: table/query
bound coulmn:1
limit to list:yes
allow value list edits:yes
inherit value list:yes
show only row source values:no
enabled:yes
locked:no
auto expand:yes
Here's my problem, the way it is set up now when i select a name in the
list, a.) it only shows the last name ( this is a problem because there are
multiple users with same last name, in fact i have some users that have the
same last name and first name, so i added the Initial field in the
tblContacts ), when i click the last name it is showing it will populate the
txt boxes on the form.
No i have tried to change the combo box so it would show the last name,
first name and middle initial.
What i did was in row source i took out the above sql statement and selected
Query1. (code follows)
And it worked, kind of, it did show the last name first name and middle
initial, but when selected it would no longer populate the txt boxes in the
form, it would set it to a new record. Any ideas what I am doing wrong here?
Any help appreciated.
CODE
SELECT IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First
Name]),IIf(IsNull([First Name]),[Last Name],[Last Name] & ", " & [First
Name])) AS [File As], IIf(IsNull([Last Name]),IIf(IsNull([First
Name]),[Company],[First Name]),IIf(IsNull([First Name]),[Last Name],[First
Name] & " " & [Last Name])) AS [Contact Name], tblContacts.*
FROM tblContacts
ORDER BY IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First
Name]),IIf(IsNull([First Name]),[Last Name],[Last Name] & ", " & [First
Name])), IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First
Name]),IIf(IsNull([First Name]),[Last Name],[First Name] & " " & [Last
Name]));