Forms!drmName!comboboxfield

  • Thread starter DMUM via AccessMonster.com
  • Start date
D

DMUM via AccessMonster.com

Hello, I am trying to open a report based upon a division name choice made by
the user on a form that contains a combo box and a command button. The form
is opened form another form by usin Docmd.openform formname, acnormal

the combobox form opens fine. The combobox on the form populates fine and is
created by using a query for the source that is grouped to remove any
duplicates of the same name.

When the user clicks on the button it should open a report which has a query
as the source. The query uses the name in the combo form/combobox to build
the criteria for the query.

Clicking on the button produces this error - Microsoft Jet database engine
does not recognize
[Forms]![frm_DivisionList]![cboDivBreakdown] as a valid name or expression.

I have never run into this before. Can anyone see where I may be going wrong?
I have used this criteria string many times with no problems.

I am using Access 2002 with SP3, does anyone know if this version has any
issues with this string?

Thanks
 
D

DMUM via AccessMonster.com

Never mind. Found out that the problem was due to the original query creator
building the new query on top of a cross tab query 4 levels deep. Seems the
cross-tab doesn't like to be built from a criteria string, although you can
put an actual criteria name in and it will filter on only that name. Who new?
Alsways something new to learn.

Thanks
Hello, I am trying to open a report based upon a division name choice made by
the user on a form that contains a combo box and a command button. The form
is opened form another form by usin Docmd.openform formname, acnormal

the combobox form opens fine. The combobox on the form populates fine and is
created by using a query for the source that is grouped to remove any
duplicates of the same name.

When the user clicks on the button it should open a report which has a query
as the source. The query uses the name in the combo form/combobox to build
the criteria for the query.

Clicking on the button produces this error - Microsoft Jet database engine
does not recognize
[Forms]![frm_DivisionList]![cboDivBreakdown] as a valid name or expression.

I have never run into this before. Can anyone see where I may be going wrong?
I have used this criteria string many times with no problems.

I am using Access 2002 with SP3, does anyone know if this version has any
issues with this string?

Thanks
 
J

John Vinson

Never mind. Found out that the problem was due to the original query creator
building the new query on top of a cross tab query 4 levels deep. Seems the
cross-tab doesn't like to be built from a criteria string, although you can
put an actual criteria name in and it will filter on only that name. Who new?
Alsways something new to learn.

A Crosstab *will* work with a parameter - but (unlike other queries,
where it's optional) you *must* put that parameter in the query's
Parameters. Right mouseclick the grey background of the tables in
query design view and select Parameters; put the exact name of the
parameter (e.g. [Forms]![Formname]![Controlname]) in the left column
and the datatype in the right.

John W. Vinson[MVP]
 
D

DMUM via AccessMonster.com

Thank you so very much! I would have never figured that one out.

John said:
Never mind. Found out that the problem was due to the original query creator
building the new query on top of a cross tab query 4 levels deep. Seems the
cross-tab doesn't like to be built from a criteria string, although you can
put an actual criteria name in and it will filter on only that name. Who new?
Alsways something new to learn.

A Crosstab *will* work with a parameter - but (unlike other queries,
where it's optional) you *must* put that parameter in the query's
Parameters. Right mouseclick the grey background of the tables in
query design view and select Parameters; put the exact name of the
parameter (e.g. [Forms]![Formname]![Controlname]) in the left column
and the datatype in the right.

John W. Vinson[MVP]
 
J

John Vinson

Thank you so very much! I would have never figured that one out.

Learned that here on this newsgroup myself, some years back. It's
documented but that documentation is VERY obscure.

John W. Vinson[MVP]
 

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