Dropdown list in a form to filter another form before it opens

O

Owl

I have tried to create a dropdown list by using a form attached to the mutual
query to filter a form before it opens.

When I open the intermediary form, it appears to work and opens the
correctly selected records in the query.

When I try to open the main form, it doesn't open the intermediary form, but
comes up with a dialog box labeled with the criterion I have entered in the
query, which seems to suggest that that there is something wrong with that
criterion in the query or there is something wrong with the field that it is
in (I have tried using Project from T01_Fixed and when it didn't work, I
tried deleting that field and including TL_Project, and putting in the field
Project from it and putting the criterion in there, but that didn't work
either). When I type in a selection into the dialog box, the main form
opens but erroneously with no selections, neither in the operative field, nor
any other field.

When I try to open the query, it comes up with the same dialog box as above,
labeled with the criterion I have entered in the query. When I type in a
selection it comes up with the message that I can't limit the list to No at
this stage. I don't have it limited to No. What could this be referring to?
Then it says that the first column visible is not the bound column and I
must fix that in Column Widths and then it opens the query, but the query is
empty. Firstly, I don't have Limit the list set to No anywhere. Secondly,
how can the first visible column be the bound column if that bound column is
an ID number?

The main form is called F01_Fixed and is based on the query Q01_Fixed which
is based on the table T01_Fixed which has a field called Project which is
lookup field to the field called Project in the table TL_Project.

The operative field in the table F01_Fixed is called Project.

The intermediary form is called DropdownProject and the field in it which
has the dropdown list is called Project.

The criterion in the query is in the field Project and is
[Forms]![DropdownProject]![Project]

Thank you for any help
 
O

Owl

My SQL view of the query is the following:

SELECT T01_Fixed.T01_ID, [StreetNo] & " " & [StreetName] AS Address,
T01_Fixed.Project, T01_Fixed.Suburb, T01_Fixed.HA,
T01_Fixed.MunicipalityCode, T01_Fixed.CBRE_ID, T01_Fixed.StreetNo,
T01_Fixed.StreetName, T01_Fixed.Erf
FROM T01_Fixed
WHERE (((T01_Fixed.Project)=[Forms]![DropdownProject]![Project]))
ORDER BY T01_Fixed.T01_ID;
 
J

John W. Vinson

I have tried to create a dropdown list by using a form attached to the mutual
query to filter a form before it opens.

When I open the intermediary form, it appears to work and opens the
correctly selected records in the query.

When I try to open the main form, it doesn't open the intermediary form, but
comes up with a dialog box labeled with the criterion I have entered in the
query, which seems to suggest that that there is something wrong with that
criterion in the query or there is something wrong with the field that it is
in (I have tried using Project from T01_Fixed and when it didn't work, I
tried deleting that field and including TL_Project, and putting in the field
Project from it and putting the criterion in there, but that didn't work
either). When I type in a selection into the dialog box, the main form
opens but erroneously with no selections, neither in the operative field, nor
any other field.

When I try to open the query, it comes up with the same dialog box as above,
labeled with the criterion I have entered in the query. When I type in a
selection it comes up with the message that I can't limit the list to No at
this stage. I don't have it limited to No. What could this be referring to?
Then it says that the first column visible is not the bound column and I
must fix that in Column Widths and then it opens the query, but the query is
empty. Firstly, I don't have Limit the list set to No anywhere. Secondly,
how can the first visible column be the bound column if that bound column is
an ID number?

The main form is called F01_Fixed and is based on the query Q01_Fixed which
is based on the table T01_Fixed which has a field called Project which is
lookup field to the field called Project in the table TL_Project.

The operative field in the table F01_Fixed is called Project.

The intermediary form is called DropdownProject and the field in it which
has the dropdown list is called Project.

The criterion in the query is in the field Project and is
[Forms]![DropdownProject]![Project]

Thank you for any help

If the "intermediary form" is in a Subform control, the syntax for the
criterion is a bit different. A Subform is not part of the Forms collection;
you must reference it via the main form:

[Forms]![Mainformname]![Subformname].Form![Project]

where Subformname is the name of the Subform Control on the mainform - this
may be the same as the name of the form within that control (DropdownProject)
but not necessarily.
 

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