Parameter Query based on field in current form

  • Thread starter cableguy47905 via AccessMonster.com
  • Start date
C

cableguy47905 via AccessMonster.com

I would like to have a cmd button open a continuous form based on a field
value on the current form. I have a query already built that the continuous
form pulls from and I have a parameter set up in it to refer to the field in
question, but I still get a pop up asking for the input for that criteria.

What am I doing wrong?
The field is
Call_ID

The query where clause is
WHERE REF_ID = [Forms]![FRM_TestData]![Call_ID]

I have made sure to define the parameter in the query. I am stumped.
Can anyone help?

Thanks,
Lee
 
M

Marshall Barton

cableguy47905 said:
I would like to have a cmd button open a continuous form based on a field
value on the current form. I have a query already built that the continuous
form pulls from and I have a parameter set up in it to refer to the field in
question, but I still get a pop up asking for the input for that criteria.

What am I doing wrong?
The field is
Call_ID

The query where clause is
WHERE REF_ID = [Forms]![FRM_TestData]![Call_ID]

I have made sure to define the parameter in the query. I am stumped.
Can anyone help?


This may be one of those times when the difference between a
field (in a table/query) and a control (on a form/report,
e.g. text box) makes a big difference.

The parameter in the query needs to refer to the control's
name, not the name of the field. For example, if the text
box control that is displaying the CallID field is named
txtCallID, then the query parameter would be:

WHERE REF_ID = [Forms]![FRM_TestData]![txtCallID]
 
C

cableguy47905 via AccessMonster.com

I did double check that, and actually the txtbox and the field are the same
name. Is this the cause? I have named all my txtboxes the same as the
control source.


Marshall said:
I would like to have a cmd button open a continuous form based on a field
value on the current form. I have a query already built that the continuous
[quoted text clipped - 10 lines]
I have made sure to define the parameter in the query. I am stumped.
Can anyone help?

This may be one of those times when the difference between a
field (in a table/query) and a control (on a form/report,
e.g. text box) makes a big difference.

The parameter in the query needs to refer to the control's
name, not the name of the field. For example, if the text
box control that is displaying the CallID field is named
txtCallID, then the query parameter would be:

WHERE REF_ID = [Forms]![FRM_TestData]![txtCallID]
 
M

Marshall Barton

Two other reasons for the popup message are if the form is
not open or if the form and/or control name are misspelled.
--
Marsh
MVP [MS Access]

I did double check that, and actually the txtbox and the field are the same
name. Is this the cause? I have named all my txtboxes the same as the
control source.


Marshall said:
I would like to have a cmd button open a continuous form based on a field
value on the current form. I have a query already built that the continuous
[quoted text clipped - 10 lines]
I have made sure to define the parameter in the query. I am stumped.
Can anyone help?

This may be one of those times when the difference between a
field (in a table/query) and a control (on a form/report,
e.g. text box) makes a big difference.

The parameter in the query needs to refer to the control's
name, not the name of the field. For example, if the text
box control that is displaying the CallID field is named
txtCallID, then the query parameter would be:

WHERE REF_ID = [Forms]![FRM_TestData]![txtCallID]
 
C

cableguy47905 via AccessMonster.com

Does the field that the query is puling from have to be an unbound field?
Mine is bound.

Marshall said:
Two other reasons for the popup message are if the form is
not open or if the form and/or control name are misspelled.
I did double check that, and actually the txtbox and the field are the same
name. Is this the cause? I have named all my txtboxes the same as the
[quoted text clipped - 16 lines]
WHERE REF_ID = [Forms]![FRM_TestData]![txtCallID]
 
C

cableguy47905 via AccessMonster.com

I finally got it. I had a space at the beginning of one of my names.

Thanks for the help.
Does the field that the query is puling from have to be an unbound field?
Mine is bound.
Two other reasons for the popup message are if the form is
not open or if the form and/or control name are misspelled.
[quoted text clipped - 3 lines]
WHERE REF_ID = [Forms]![FRM_TestData]![txtCallID]
 

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