form and query relationship problem

L

lazerbrain

Using Access 2000. I have a form with a combo box and a command button set to
open a query. The query criteria is Forms!FormName!ComboBoxName. I also tried
putting Forms!FormName!ComboBoxName in the query>parameter but that didn't
help. My problem is when I press the command button it opens the 'enter
parameter value box' rather than using what was selected in the combo box as
the filter. I know its probably simple enough but I would appreciate the
help. Thanks.
 
O

Ofer

Can you please post
1. name of the form
2. the name of the combo
3. the sql with the where condition
 
L

lazerbrain

The name of the form is ParamForm. The combo box name is SYSTEM.
sql:
PARAMETERS Form!ParamForm!SYSTEM Text ( 255 );
SELECT [DRAWINGS AND DOCUMENTS].SYSTEM, [DRAWINGS AND DOCUMENTS].[Site DRWG
#], [DRAWINGS AND DOCUMENTS].[DOCUMENT #], [DRAWINGS AND DOCUMENTS].LOCATION,
[DRAWINGS AND DOCUMENTS].DESCRIPTION, [DRAWINGS AND DOCUMENTS].TITLE
FROM [DRAWINGS AND DOCUMENTS]
WHERE ((([DRAWINGS AND DOCUMENTS].SYSTEM)=[Form]![ParamForm]![SYSTEM]));

Thanks again.
 
O

Ofer

The parameter name start with form and not forms, try this

SELECT [DRAWINGS AND DOCUMENTS].SYSTEM, [DRAWINGS AND DOCUMENTS].[Site DRWG
#], [DRAWINGS AND DOCUMENTS].[DOCUMENT #], [DRAWINGS AND DOCUMENTS].LOCATION,
[DRAWINGS AND DOCUMENTS].DESCRIPTION, [DRAWINGS AND DOCUMENTS].TITLE
FROM [DRAWINGS AND DOCUMENTS]
WHERE ((([DRAWINGS AND DOCUMENTS].SYSTEM)=[Forms]![ParamForm]![SYSTEM]));

lazerbrain said:
The name of the form is ParamForm. The combo box name is SYSTEM.
sql:
PARAMETERS Form!ParamForm!SYSTEM Text ( 255 );
SELECT [DRAWINGS AND DOCUMENTS].SYSTEM, [DRAWINGS AND DOCUMENTS].[Site DRWG
#], [DRAWINGS AND DOCUMENTS].[DOCUMENT #], [DRAWINGS AND DOCUMENTS].LOCATION,
[DRAWINGS AND DOCUMENTS].DESCRIPTION, [DRAWINGS AND DOCUMENTS].TITLE
FROM [DRAWINGS AND DOCUMENTS]
WHERE ((([DRAWINGS AND DOCUMENTS].SYSTEM)=[Form]![ParamForm]![SYSTEM]));

Thanks again.

Ofer said:
Can you please post
1. name of the form
2. the name of the combo
3. the sql with the where condition
 
L

lazerbrain

Made some progress with that change but I have a new problem. Now when I hit
the command button it opens the query but there are no records in the table
even though the combo box has the filter information selected.

Ofer said:
The parameter name start with form and not forms, try this

SELECT [DRAWINGS AND DOCUMENTS].SYSTEM, [DRAWINGS AND DOCUMENTS].[Site DRWG
#], [DRAWINGS AND DOCUMENTS].[DOCUMENT #], [DRAWINGS AND DOCUMENTS].LOCATION,
[DRAWINGS AND DOCUMENTS].DESCRIPTION, [DRAWINGS AND DOCUMENTS].TITLE
FROM [DRAWINGS AND DOCUMENTS]
WHERE ((([DRAWINGS AND DOCUMENTS].SYSTEM)=[Forms]![ParamForm]![SYSTEM]));

lazerbrain said:
The name of the form is ParamForm. The combo box name is SYSTEM.
sql:
PARAMETERS Form!ParamForm!SYSTEM Text ( 255 );
SELECT [DRAWINGS AND DOCUMENTS].SYSTEM, [DRAWINGS AND DOCUMENTS].[Site DRWG
#], [DRAWINGS AND DOCUMENTS].[DOCUMENT #], [DRAWINGS AND DOCUMENTS].LOCATION,
[DRAWINGS AND DOCUMENTS].DESCRIPTION, [DRAWINGS AND DOCUMENTS].TITLE
FROM [DRAWINGS AND DOCUMENTS]
WHERE ((([DRAWINGS AND DOCUMENTS].SYSTEM)=[Form]![ParamForm]![SYSTEM]));

Thanks again.

Ofer said:
Can you please post
1. name of the form
2. the name of the combo
3. the sql with the where condition

:

Using Access 2000. I have a form with a combo box and a command button set to
open a query. The query criteria is Forms!FormName!ComboBoxName. I also tried
putting Forms!FormName!ComboBoxName in the query>parameter but that didn't
help. My problem is when I press the command button it opens the 'enter
parameter value box' rather than using what was selected in the combo box as
the filter. I know its probably simple enough but I would appreciate the
help. Thanks.
 
O

Ofer

How many fields are in the combo field source, mybe the system field is not
the first field so you actually filtering on a different value.
After selecting a value in the combo, open the immidiate window, copy the
reference to the combo and see what value you getting
?Forms![ParamForm]![SYSTEM]

if the value you getting is the system field then, run the query with this
value to see if you getting any result.
If its not the system value, then change it to the right column
?Forms![ParamForm]![SYSTEM].column(1) or else


lazerbrain said:
Made some progress with that change but I have a new problem. Now when I hit
the command button it opens the query but there are no records in the table
even though the combo box has the filter information selected.

Ofer said:
The parameter name start with form and not forms, try this

SELECT [DRAWINGS AND DOCUMENTS].SYSTEM, [DRAWINGS AND DOCUMENTS].[Site DRWG
#], [DRAWINGS AND DOCUMENTS].[DOCUMENT #], [DRAWINGS AND DOCUMENTS].LOCATION,
[DRAWINGS AND DOCUMENTS].DESCRIPTION, [DRAWINGS AND DOCUMENTS].TITLE
FROM [DRAWINGS AND DOCUMENTS]
WHERE ((([DRAWINGS AND DOCUMENTS].SYSTEM)=[Forms]![ParamForm]![SYSTEM]));

lazerbrain said:
The name of the form is ParamForm. The combo box name is SYSTEM.
sql:
PARAMETERS Form!ParamForm!SYSTEM Text ( 255 );
SELECT [DRAWINGS AND DOCUMENTS].SYSTEM, [DRAWINGS AND DOCUMENTS].[Site DRWG
#], [DRAWINGS AND DOCUMENTS].[DOCUMENT #], [DRAWINGS AND DOCUMENTS].LOCATION,
[DRAWINGS AND DOCUMENTS].DESCRIPTION, [DRAWINGS AND DOCUMENTS].TITLE
FROM [DRAWINGS AND DOCUMENTS]
WHERE ((([DRAWINGS AND DOCUMENTS].SYSTEM)=[Form]![ParamForm]![SYSTEM]));

Thanks again.

:

Can you please post
1. name of the form
2. the name of the combo
3. the sql with the where condition

:

Using Access 2000. I have a form with a combo box and a command button set to
open a query. The query criteria is Forms!FormName!ComboBoxName. I also tried
putting Forms!FormName!ComboBoxName in the query>parameter but that didn't
help. My problem is when I press the command button it opens the 'enter
parameter value box' rather than using what was selected in the combo box as
the filter. I know its probably simple enough but I would appreciate the
help. Thanks.
 
L

lazerbrain

I only have one field source for the combo box. I'm not sure what you mean by
open immediate window?

Ofer said:
How many fields are in the combo field source, mybe the system field is not
the first field so you actually filtering on a different value.
After selecting a value in the combo, open the immidiate window, copy the
reference to the combo and see what value you getting
?Forms![ParamForm]![SYSTEM]

if the value you getting is the system field then, run the query with this
value to see if you getting any result.
If its not the system value, then change it to the right column
?Forms![ParamForm]![SYSTEM].column(1) or else


lazerbrain said:
Made some progress with that change but I have a new problem. Now when I hit
the command button it opens the query but there are no records in the table
even though the combo box has the filter information selected.

Ofer said:
The parameter name start with form and not forms, try this

SELECT [DRAWINGS AND DOCUMENTS].SYSTEM, [DRAWINGS AND DOCUMENTS].[Site DRWG
#], [DRAWINGS AND DOCUMENTS].[DOCUMENT #], [DRAWINGS AND DOCUMENTS].LOCATION,
[DRAWINGS AND DOCUMENTS].DESCRIPTION, [DRAWINGS AND DOCUMENTS].TITLE
FROM [DRAWINGS AND DOCUMENTS]
WHERE ((([DRAWINGS AND DOCUMENTS].SYSTEM)=[Forms]![ParamForm]![SYSTEM]));

:

The name of the form is ParamForm. The combo box name is SYSTEM.
sql:
PARAMETERS Form!ParamForm!SYSTEM Text ( 255 );
SELECT [DRAWINGS AND DOCUMENTS].SYSTEM, [DRAWINGS AND DOCUMENTS].[Site DRWG
#], [DRAWINGS AND DOCUMENTS].[DOCUMENT #], [DRAWINGS AND DOCUMENTS].LOCATION,
[DRAWINGS AND DOCUMENTS].DESCRIPTION, [DRAWINGS AND DOCUMENTS].TITLE
FROM [DRAWINGS AND DOCUMENTS]
WHERE ((([DRAWINGS AND DOCUMENTS].SYSTEM)=[Form]![ParamForm]![SYSTEM]));

Thanks again.

:

Can you please post
1. name of the form
2. the name of the combo
3. the sql with the where condition

:

Using Access 2000. I have a form with a combo box and a command button set to
open a query. The query criteria is Forms!FormName!ComboBoxName. I also tried
putting Forms!FormName!ComboBoxName in the query>parameter but that didn't
help. My problem is when I press the command button it opens the 'enter
parameter value box' rather than using what was selected in the combo box as
the filter. I know its probably simple enough but I would appreciate the
help. Thanks.
 
O

Ofer

press the ctrl+G, it will open it, you can check variable values there, and
use for many things

lazerbrain said:
I only have one field source for the combo box. I'm not sure what you mean by
open immediate window?

Ofer said:
How many fields are in the combo field source, mybe the system field is not
the first field so you actually filtering on a different value.
After selecting a value in the combo, open the immidiate window, copy the
reference to the combo and see what value you getting
?Forms![ParamForm]![SYSTEM]

if the value you getting is the system field then, run the query with this
value to see if you getting any result.
If its not the system value, then change it to the right column
?Forms![ParamForm]![SYSTEM].column(1) or else


lazerbrain said:
Made some progress with that change but I have a new problem. Now when I hit
the command button it opens the query but there are no records in the table
even though the combo box has the filter information selected.

:

The parameter name start with form and not forms, try this

SELECT [DRAWINGS AND DOCUMENTS].SYSTEM, [DRAWINGS AND DOCUMENTS].[Site DRWG
#], [DRAWINGS AND DOCUMENTS].[DOCUMENT #], [DRAWINGS AND DOCUMENTS].LOCATION,
[DRAWINGS AND DOCUMENTS].DESCRIPTION, [DRAWINGS AND DOCUMENTS].TITLE
FROM [DRAWINGS AND DOCUMENTS]
WHERE ((([DRAWINGS AND DOCUMENTS].SYSTEM)=[Forms]![ParamForm]![SYSTEM]));

:

The name of the form is ParamForm. The combo box name is SYSTEM.
sql:
PARAMETERS Form!ParamForm!SYSTEM Text ( 255 );
SELECT [DRAWINGS AND DOCUMENTS].SYSTEM, [DRAWINGS AND DOCUMENTS].[Site DRWG
#], [DRAWINGS AND DOCUMENTS].[DOCUMENT #], [DRAWINGS AND DOCUMENTS].LOCATION,
[DRAWINGS AND DOCUMENTS].DESCRIPTION, [DRAWINGS AND DOCUMENTS].TITLE
FROM [DRAWINGS AND DOCUMENTS]
WHERE ((([DRAWINGS AND DOCUMENTS].SYSTEM)=[Form]![ParamForm]![SYSTEM]));

Thanks again.

:

Can you please post
1. name of the form
2. the name of the combo
3. the sql with the where condition

:

Using Access 2000. I have a form with a combo box and a command button set to
open a query. The query criteria is Forms!FormName!ComboBoxName. I also tried
putting Forms!FormName!ComboBoxName in the query>parameter but that didn't
help. My problem is when I press the command button it opens the 'enter
parameter value box' rather than using what was selected in the combo box as
the filter. I know its probably simple enough but I would appreciate the
help. Thanks.
 

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