Query parameter is field on subform?

G

Guest

This is what I have that works:
txtAssignee on frmMain
qrySARs_By_Assignee with this Criteria for SAR_Assignees:
Like "*" & [Forms]![frmMain]![txtAssignee] & "*"

Now I want to use a Tab Control on frmMain, I dragged a form onto one of the
tabs, which makes it a subform (right?). I double-checked the name of this
subform--it is frmTabA--and it has the field txtAssignee. I changed the
Criteria for SAR_Assignees in qrySARs_By_Assignee to:
Like "*" & [Forms]![frmMain]![frmTabA].[Form]![txtAssignee] & "*"

This does not work. When I click the button to open the form that uses this
query as it's source I get a pop-up, "Enter Parameter Value
Forms!frmMain!frmTabA.Form!txtAssignee". I must not be referencing the text
box correctly. Can someone help me out with this?

Thank you,
Judy
 
G

Guest

Sorry for askng this questions, but just to make sure
1. When you open the second form, does the first form is already open?
2. The frmTabA need to be the name of the frame of the sub form in the main
form, and not the actual name of the subform.
3. The thing that made me puzeled
[Forms]![frmMain]![txtAssignee]
[Forms]![frmMain]![frmTabA].[Form]![txtAssignee]

The first one worked, the second one not.
You said that you made the frmMain, from the first example, into a subform,
so how come the main form still called frmMain, mybe the main form has a
different name?
 
G

Guest

I renamed my original frmMain and created a new one with the Tab Control.
I created a form named frmForms (because it opens forms) and dragged this
onto a tab. I named it frmTabA as the subform. I read up on how to refer to
fields on a subform--can't figure out why this is not working.

Ofer said:
Sorry for askng this questions, but just to make sure
1. When you open the second form, does the first form is already open?
2. The frmTabA need to be the name of the frame of the sub form in the main
form, and not the actual name of the subform.
3. The thing that made me puzeled
[Forms]![frmMain]![txtAssignee]
[Forms]![frmMain]![frmTabA].[Form]![txtAssignee]

The first one worked, the second one not.
You said that you made the frmMain, from the first example, into a subform,
so how come the main form still called frmMain, mybe the main form has a
different name?

--
I hope that helped
Good luck


Judy Ward said:
This is what I have that works:
txtAssignee on frmMain
qrySARs_By_Assignee with this Criteria for SAR_Assignees:
Like "*" & [Forms]![frmMain]![txtAssignee] & "*"

Now I want to use a Tab Control on frmMain, I dragged a form onto one of the
tabs, which makes it a subform (right?). I double-checked the name of this
subform--it is frmTabA--and it has the field txtAssignee. I changed the
Criteria for SAR_Assignees in qrySARs_By_Assignee to:
Like "*" & [Forms]![frmMain]![frmTabA].[Form]![txtAssignee] & "*"

This does not work. When I click the button to open the form that uses this
query as it's source I get a pop-up, "Enter Parameter Value
Forms!frmMain!frmTabA.Form!txtAssignee". I must not be referencing the text
box correctly. Can someone help me out with this?

Thank you,
Judy
 
G

Guest

When the form is running, open the immidiate window (Ctrl+G) type
?Forms!frmMain!frmTabA.Form!txtAssignee

And see if it return a value or gives an error

If that works fine, can you post the SQL?
--
I hope that helped
Good luck


Judy Ward said:
I renamed my original frmMain and created a new one with the Tab Control.
I created a form named frmForms (because it opens forms) and dragged this
onto a tab. I named it frmTabA as the subform. I read up on how to refer to
fields on a subform--can't figure out why this is not working.

Ofer said:
Sorry for askng this questions, but just to make sure
1. When you open the second form, does the first form is already open?
2. The frmTabA need to be the name of the frame of the sub form in the main
form, and not the actual name of the subform.
3. The thing that made me puzeled
[Forms]![frmMain]![txtAssignee]
[Forms]![frmMain]![frmTabA].[Form]![txtAssignee]

The first one worked, the second one not.
You said that you made the frmMain, from the first example, into a subform,
so how come the main form still called frmMain, mybe the main form has a
different name?

--
I hope that helped
Good luck


Judy Ward said:
This is what I have that works:
txtAssignee on frmMain
qrySARs_By_Assignee with this Criteria for SAR_Assignees:
Like "*" & [Forms]![frmMain]![txtAssignee] & "*"

Now I want to use a Tab Control on frmMain, I dragged a form onto one of the
tabs, which makes it a subform (right?). I double-checked the name of this
subform--it is frmTabA--and it has the field txtAssignee. I changed the
Criteria for SAR_Assignees in qrySARs_By_Assignee to:
Like "*" & [Forms]![frmMain]![frmTabA].[Form]![txtAssignee] & "*"

This does not work. When I click the button to open the form that uses this
query as it's source I get a pop-up, "Enter Parameter Value
Forms!frmMain!frmTabA.Form!txtAssignee". I must not be referencing the text
box correctly. Can someone help me out with this?

Thank you,
Judy
 

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