Filter by form - empty drop down list

J

jaworski_m

A form is based on a query:

Last Name, Name: [lastName] & [name]
field1 from tbl1
field2 from tbl1
....

where: lastName - last name of employee
name - name of employee
field1,field2 - other fields from table "tbl1"

When I filter by form, a drop down list "Last Name,Name" (concatenation of 2
fields: name & lastName) is empty. Why?
Is there a way to display values when concatenated fields are used in
"filter by form" view?

Thank you for suggestions.

Access 2003
Win XP
 
J

June7

Would help to see the query that is in the form's recordsource property. I
think it would be something like:
"SELECT *, (lastname & name) As EmpName FROM tbl1 ORDER BY (lastname & name);"
Then your combobox RowSource should be the concatenated field EmpName.
 
J

jaworski_m

Thank you for you answer.

The query that is used for the form looks as follows:

SELECT tblEmployees.id, [lastName] & ", " & [name] AS [Last name, Name],
tblEmployees.position
FROM tblEmployees;

Well, all data in the form is displayed correctly. The problem is with
filtering "filter by form" method)
When pressing drop down list of "Last name, Name" field in "filter by form"
view, the list is empty.

June7 said:
Would help to see the query that is in the form's recordsource property. I
think it would be something like:
"SELECT *, (lastname & name) As EmpName FROM tbl1 ORDER BY (lastname & name);"
Then your combobox RowSource should be the concatenated field EmpName.

jaworski_m said:
A form is based on a query:

Last Name, Name: [lastName] & [name]
field1 from tbl1
field2 from tbl1
...

where: lastName - last name of employee
name - name of employee
field1,field2 - other fields from table "tbl1"

When I filter by form, a drop down list "Last Name,Name" (concatenation of 2
fields: name & lastName) is empty. Why?
Is there a way to display values when concatenated fields are used in
"filter by form" view?

Thank you for suggestions.

Access 2003
Win XP
 
J

June7

First make sure the combo box RowSourceType is set to FieldList. If that
doesn't help, build and save this as an independent query, then set your
combo box RowSourceType to Table/Query and RowSource to the concatenated
field name of that query. Suggest simplifying the name to something like
EmpName, comma should not be necessary and may even hinder process.
Otherwise, don't see any problem with the query syntax, may have to exist
outside the form because my experiment to see concatenated field also failed
when the query was only in the form's RecordSource property. I would have
thought that setting the RowSourceType to FieldList would show the
concatenated field but did not work. Good Luck.

June7 said:
Would help to see the query that is in the form's recordsource property. I
think it would be something like:
"SELECT *, (lastname & name) As EmpName FROM tbl1 ORDER BY (lastname & name);"
Then your combobox RowSource should be the concatenated field EmpName.

jaworski_m said:
A form is based on a query:

Last Name, Name: [lastName] & [name]
field1 from tbl1
field2 from tbl1
...

where: lastName - last name of employee
name - name of employee
field1,field2 - other fields from table "tbl1"

When I filter by form, a drop down list "Last Name,Name" (concatenation of 2
fields: name & lastName) is empty. Why?
Is there a way to display values when concatenated fields are used in
"filter by form" view?

Thank you for suggestions.

Access 2003
Win XP
 

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