Very strange behaviour of criteria in Access query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have constucted a form (frmAdmin) that has a combo box (cboStaff2) and a
list box. The list box is fed by a query that uses the entry in the combo box
as it's selection criteria - i.e. you select a teacher from the combo box,
and the list box returns a list of the pupils for that teacher. The selection
criteria in the query takes the form: [Forms]![frmAdmin]![cboStaff2].
However, when I open the form, it has now started asking for data from
[Forms]![frmAAAA]![cboStaff2] - an entirely different form (but curiously,
the first form in my database). When I open the query in design mode, I find
that the criteria has changed by itself. Resetting the criteria works fine
until I close and open the database and it's magically gone wrong again. Is
this a bug, or is it likely that I'm doing something wrong?
 
Huw Davies said:
I have constucted a form (frmAdmin) that has a combo box (cboStaff2)
and a list box. The list box is fed by a query that uses the entry in
the combo box as it's selection criteria - i.e. you select a teacher
from the combo box, and the list box returns a list of the pupils for
that teacher. The selection criteria in the query takes the form:
[Forms]![frmAdmin]![cboStaff2]. However, when I open the form, it has
now started asking for data from [Forms]![frmAAAA]![cboStaff2] - an
entirely different form (but curiously, the first form in my
database). When I open the query in design mode, I find that the
criteria has changed by itself. Resetting the criteria works fine
until I close and open the database and it's magically gone wrong
again. Is this a bug, or is it likely that I'm doing something wrong?

My guess is that this is the result of the Name AutoCorrect misfeature.
Click Tools -> Options..., go to the General tab, and disable it. See
if that corrects the problem.
 
Dirk - Many, many thanks for your prompt response. In short, your solution
appears to have worked but I had a slight panic when I first turned off the
Name Autocorrect "misfeature" as it seemed to make the problem worse - i.e.
the criteria changed without me closing and re-opening the database!!
However, since that initial scare, I have closed and re-opened the system
several times and everything seems hunky-dory. Thanks again.

Dirk Goldgar said:
Huw Davies said:
I have constucted a form (frmAdmin) that has a combo box (cboStaff2)
and a list box. The list box is fed by a query that uses the entry in
the combo box as it's selection criteria - i.e. you select a teacher
from the combo box, and the list box returns a list of the pupils for
that teacher. The selection criteria in the query takes the form:
[Forms]![frmAdmin]![cboStaff2]. However, when I open the form, it has
now started asking for data from [Forms]![frmAAAA]![cboStaff2] - an
entirely different form (but curiously, the first form in my
database). When I open the query in design mode, I find that the
criteria has changed by itself. Resetting the criteria works fine
until I close and open the database and it's magically gone wrong
again. Is this a bug, or is it likely that I'm doing something wrong?

My guess is that this is the result of the Name AutoCorrect misfeature.
Click Tools -> Options..., go to the General tab, and disable it. See
if that corrects the problem.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top