Query error when getting value from a subform

G

Guest

Here's is my exact syntax for the query criteria with the respective
mainform and subform names, and "SYSTEM" as the field name:

[Forms]![frm Research Database Users]![frm Research Database
Subform].[Form]![SYSTEM]

It returns a pop-up to enter the parameter value.
 
A

Allen Browne

Open your main form in design view.
Right-click the edge of the subform control, and choose Properties.
What is the Name property (Other tab of Properties box)?

The name of the subform control can be different from it SourceObject (the
name of the form that is loaded into the control.)
 
G

Guest

What parameter value does it ask for? Form? System?

It appears that you have too many parts - try something like this --
[Forms]![frm Research Database Users]![frm Research Database Subform]![SYSTEM]

It should be Forms - MainFormName - SubformName - ControlName
 
D

Douglas J Steele

Are you sure that the subform container on frm Research Database Users (the
control that frm Research Database Subform is in) is named frm Research
Database Subform? If it's not, that's the name that you want there.
 
G

Guest

Ok, I corrected the container name to read "frm Research Database Subform",
but I'm still being prompted for a parameter value. The message reads -
Frms!Research Database Users!frm

Douglas J Steele said:
Are you sure that the subform container on frm Research Database Users (the
control that frm Research Database Subform is in) is named frm Research
Database Subform? If it's not, that's the name that you want there.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
Here's is my exact syntax for the query criteria with the respective
mainform and subform names, and "SYSTEM" as the field name:

[Forms]![frm Research Database Users]![frm Research Database
Subform].[Form]![SYSTEM]

It returns a pop-up to enter the parameter value.
 
D

Douglas J Steele

You sure about what you posted earlier then? Sounds as though your query is
looking for a form named Research Database Users, not frm Research Database
Users as you posted before.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
Ok, I corrected the container name to read "frm Research Database Subform",
but I'm still being prompted for a parameter value. The message reads -
Frms!Research Database Users!frm

Douglas J Steele said:
Are you sure that the subform container on frm Research Database Users (the
control that frm Research Database Subform is in) is named frm Research
Database Subform? If it's not, that's the name that you want there.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
Here's is my exact syntax for the query criteria with the respective
mainform and subform names, and "SYSTEM" as the field name:

[Forms]![frm Research Database Users]![frm Research Database
Subform].[Form]![SYSTEM]

It returns a pop-up to enter the parameter value.
 
G

Guest

Douglas J Steele said:
You sure about what you posted earlier then? Sounds as though your query is
looking for a form named Research Database Users, not frm Research Database
Users as you posted before.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
Ok, I corrected the container name to read "frm Research Database Subform",
but I'm still being prompted for a parameter value. The message reads -
Frms!Research Database Users!frm

Douglas J Steele said:
Are you sure that the subform container on frm Research Database Users (the
control that frm Research Database Subform is in) is named frm Research
Database Subform? If it's not, that's the name that you want there.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Here's is my exact syntax for the query criteria with the respective
mainform and subform names, and "SYSTEM" as the field name:

[Forms]![frm Research Database Users]![frm Research Database
Subform].[Form]![SYSTEM]

It returns a pop-up to enter the parameter value.
 
G

Guest

As far I i can tell, the mainform name is correct. How can I verify, "name"
doesn't appear when I diplay the mainform properties.

Douglas J Steele said:
You sure about what you posted earlier then? Sounds as though your query is
looking for a form named Research Database Users, not frm Research Database
Users as you posted before.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
Ok, I corrected the container name to read "frm Research Database Subform",
but I'm still being prompted for a parameter value. The message reads -
Frms!Research Database Users!frm

Douglas J Steele said:
Are you sure that the subform container on frm Research Database Users (the
control that frm Research Database Subform is in) is named frm Research
Database Subform? If it's not, that's the name that you want there.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Here's is my exact syntax for the query criteria with the respective
mainform and subform names, and "SYSTEM" as the field name:

[Forms]![frm Research Database Users]![frm Research Database
Subform].[Form]![SYSTEM]

It returns a pop-up to enter the parameter value.
 
D

Douglas J Steele

You can see the name of the form in the Database window. You can also put
code (say, in its Open event) to display the name. Something like MsgBox
Me.Name

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
As far I i can tell, the mainform name is correct. How can I verify, "name"
doesn't appear when I diplay the mainform properties.

Douglas J Steele said:
You sure about what you posted earlier then? Sounds as though your query is
looking for a form named Research Database Users, not frm Research Database
Users as you posted before.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
Ok, I corrected the container name to read "frm Research Database Subform",
but I'm still being prompted for a parameter value. The message reads -
Frms!Research Database Users!frm

:

Are you sure that the subform container on frm Research Database
Users
(the
control that frm Research Database Subform is in) is named frm Research
Database Subform? If it's not, that's the name that you want there.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Here's is my exact syntax for the query criteria with the respective
mainform and subform names, and "SYSTEM" as the field name:

[Forms]![frm Research Database Users]![frm Research Database
Subform].[Form]![SYSTEM]

It returns a pop-up to enter the parameter value.
 
G

Guest

OK, so I confirmed the main form name and the subform control, and updated
the query accordingly. Still not getting the value. Any other thoughts?

Douglas J Steele said:
You can see the name of the form in the Database window. You can also put
code (say, in its Open event) to display the name. Something like MsgBox
Me.Name

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
As far I i can tell, the mainform name is correct. How can I verify, "name"
doesn't appear when I diplay the mainform properties.

Douglas J Steele said:
You sure about what you posted earlier then? Sounds as though your query is
looking for a form named Research Database Users, not frm Research Database
Users as you posted before.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ok, I corrected the container name to read "frm Research Database
Subform",
but I'm still being prompted for a parameter value. The message reads -
Frms!Research Database Users!frm

:

Are you sure that the subform container on frm Research Database Users
(the
control that frm Research Database Subform is in) is named frm Research
Database Subform? If it's not, that's the name that you want there.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Here's is my exact syntax for the query criteria with the respective
mainform and subform names, and "SYSTEM" as the field name:

[Forms]![frm Research Database Users]![frm Research Database
Subform].[Form]![SYSTEM]

It returns a pop-up to enter the parameter value.
 
D

Douglas J Steele

Where are you using this query? For a form, or a report?

If a report, check whether you've got a reference to the incorrect name,
especially in the Sorting and Grouping dialog, or as a value in a header.

There are fewer places to check with a form, but you could perhaps have a
reference to the name in a filter, or in a bound control.

To help, you could try using the undocumented "ExportToText" method:

Application.SaveAsText [acForm or acReport], "Name of Form or Report", "Full
path to text file"

and then do a search in that text file. I talk about using this method in my
February, 2005 "Access Answers" column in Pinnacle Publication's "Smart
Access". You can download the column (and sample database) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
OK, so I confirmed the main form name and the subform control, and updated
the query accordingly. Still not getting the value. Any other thoughts?

Douglas J Steele said:
You can see the name of the form in the Database window. You can also put
code (say, in its Open event) to display the name. Something like MsgBox
Me.Name

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
As far I i can tell, the mainform name is correct. How can I verify, "name"
doesn't appear when I diplay the mainform properties.

:

You sure about what you posted earlier then? Sounds as though your
query
is
looking for a form named Research Database Users, not frm Research Database
Users as you posted before.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ok, I corrected the container name to read "frm Research Database
Subform",
but I'm still being prompted for a parameter value. The message reads -
Frms!Research Database Users!frm

:

Are you sure that the subform container on frm Research Database Users
(the
control that frm Research Database Subform is in) is named frm Research
Database Subform? If it's not, that's the name that you want there.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Here's is my exact syntax for the query criteria with the respective
mainform and subform names, and "SYSTEM" as the field name:

[Forms]![frm Research Database Users]![frm Research Database
Subform].[Form]![SYSTEM]

It returns a pop-up to enter the parameter value.
 
G

Guest

I'm using the query on a form.

Where do I enter - Application.SaveAsText [acForm or acReport], "Name of
Form or Report", "Full path to text file"?


Douglas J Steele said:
Where are you using this query? For a form, or a report?

If a report, check whether you've got a reference to the incorrect name,
especially in the Sorting and Grouping dialog, or as a value in a header.

There are fewer places to check with a form, but you could perhaps have a
reference to the name in a filter, or in a bound control.

To help, you could try using the undocumented "ExportToText" method:

Application.SaveAsText [acForm or acReport], "Name of Form or Report", "Full
path to text file"

and then do a search in that text file. I talk about using this method in my
February, 2005 "Access Answers" column in Pinnacle Publication's "Smart
Access". You can download the column (and sample database) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
OK, so I confirmed the main form name and the subform control, and updated
the query accordingly. Still not getting the value. Any other thoughts?

Douglas J Steele said:
You can see the name of the form in the Database window. You can also put
code (say, in its Open event) to display the name. Something like MsgBox
Me.Name

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


As far I i can tell, the mainform name is correct. How can I verify,
"name"
doesn't appear when I diplay the mainform properties.

:

You sure about what you posted earlier then? Sounds as though your query
is
looking for a form named Research Database Users, not frm Research
Database
Users as you posted before.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ok, I corrected the container name to read "frm Research Database
Subform",
but I'm still being prompted for a parameter value. The message
reads -
Frms!Research Database Users!frm

:

Are you sure that the subform container on frm Research Database
Users
(the
control that frm Research Database Subform is in) is named frm
Research
Database Subform? If it's not, that's the name that you want there.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Here's is my exact syntax for the query criteria with the
respective
mainform and subform names, and "SYSTEM" as the field name:

[Forms]![frm Research Database Users]![frm Research Database
Subform].[Form]![SYSTEM]

It returns a pop-up to enter the parameter value.
 
D

Douglas J. Steele

Open the Immediate windows (Ctrl-G), and just type it there.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


DV said:
I'm using the query on a form.

Where do I enter - Application.SaveAsText [acForm or acReport], "Name of
Form or Report", "Full path to text file"?


Douglas J Steele said:
Where are you using this query? For a form, or a report?

If a report, check whether you've got a reference to the incorrect name,
especially in the Sorting and Grouping dialog, or as a value in a header.

There are fewer places to check with a form, but you could perhaps have a
reference to the name in a filter, or in a bound control.

To help, you could try using the undocumented "ExportToText" method:

Application.SaveAsText [acForm or acReport], "Name of Form or Report",
"Full
path to text file"

and then do a search in that text file. I talk about using this method in
my
February, 2005 "Access Answers" column in Pinnacle Publication's "Smart
Access". You can download the column (and sample database) for free at
http://www.accessmvp.com/DJSteele/SmartAccess.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DV said:
OK, so I confirmed the main form name and the subform control, and
updated
the query accordingly. Still not getting the value. Any other
thoughts?

:

You can see the name of the form in the Database window. You can also put
code (say, in its Open event) to display the name. Something like
MsgBox
Me.Name

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


As far I i can tell, the mainform name is correct. How can I
verify,
"name"
doesn't appear when I diplay the mainform properties.

:

You sure about what you posted earlier then? Sounds as though
your query
is
looking for a form named Research Database Users, not frm
Research
Database
Users as you posted before.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Ok, I corrected the container name to read "frm Research
Database
Subform",
but I'm still being prompted for a parameter value. The
message
reads -
Frms!Research Database Users!frm

:

Are you sure that the subform container on frm Research
Database
Users
(the
control that frm Research Database Subform is in) is named
frm
Research
Database Subform? If it's not, that's the name that you want there.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Here's is my exact syntax for the query criteria with the
respective
mainform and subform names, and "SYSTEM" as the field name:

[Forms]![frm Research Database Users]![frm Research
Database
Subform].[Form]![SYSTEM]

It returns a pop-up to enter the parameter value.
 

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