By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,289 Members | 1,699 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,289 IT Pros & Developers. It's quick & easy.

Access re-writes combobox row source query

P: n/a
I have a combobox on a form with the following row source SQL query.

SELECT tblSupplyType.SupplyName, tblSupplyType.PWS_ID
FROM tblSupplyType
WHERE (((tblSupplyType.SupplyName)=Forms![LoginInfo]!bxPWSName2));

After I close the form, Access rewrites the query to this:

SELECT tblSupplyType.SupplyName, tblSupplyType.PWS_ID
FROM tblSupplyType
WHERE
(((tblSupplyType.SupplyName)=Forms![AddSingleRecord]!bxPWSName2));

The change is in the WHERE clause. The correct form is discarded and
another form is substitued. Net result is the combobox does not get the
right recordset.

I can't figure out why Access is changing the query or how to stop it.
I'd appreciate any ideas.

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
we*****@gru.com wrote:
I have a combobox on a form with the following row source SQL query.

SELECT tblSupplyType.SupplyName, tblSupplyType.PWS_ID
FROM tblSupplyType
WHERE (((tblSupplyType.SupplyName)=Forms![LoginInfo]!bxPWSName2));

After I close the form, Access rewrites the query to this:

SELECT tblSupplyType.SupplyName, tblSupplyType.PWS_ID
FROM tblSupplyType
WHERE
(((tblSupplyType.SupplyName)=Forms![AddSingleRecord]!bxPWSName2));

The change is in the WHERE clause. The correct form is discarded and
another form is substitued. Net result is the combobox does not get the
right recordset.

I can't figure out why Access is changing the query or how to stop it.
I'd appreciate any ideas.

Are you closing it when you are in error/debug mode. Open the form in
design mode when not in error and then modify the query, close the query
and then press the Save button off the toolbar before closeing the form.

If that doesn't work, create a query and substitute your select with the
query name.
Nov 13 '05 #2

P: n/a
we*****@gru.com wrote in
news:11**********************@g14g2000cwa.googlegr oups.com:
I have a combobox on a form with the following row source SQL
query.

SELECT tblSupplyType.SupplyName, tblSupplyType.PWS_ID
FROM tblSupplyType
WHERE
(((tblSupplyType.SupplyName)=Forms![LoginInfo]!bxPWSName2));

After I close the form, Access rewrites the query to this:

SELECT tblSupplyType.SupplyName, tblSupplyType.PWS_ID
FROM tblSupplyType
WHERE
(((tblSupplyType.SupplyName)=Forms![AddSingleRecord]!bxPWSName2
));

The change is in the WHERE clause. The correct form is
discarded and another form is substitued. Net result is the
combobox does not get the right recordset.

I can't figure out why Access is changing the query or how to
stop it. I'd appreciate any ideas.

Are you using a version of Access >= 2000, and have not disabled
the NameAutoCorrect b\u\g\Feature from the Tools>Options>General
menu?

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #3

P: n/a
Bob,

True in both cases, Access 2003 & perform name AutoCorrect = enabled.

Once I disabled the name AutoCorrect, Access quit rewriting my query.

Thanks x10!

Andrew

Nov 13 '05 #4

P: n/a
we*****@gru.com wrote in
news:11********************@g14g2000cwa.googlegrou ps.com:
Bob,

True in both cases, Access 2003 & perform name AutoCorrect =
enabled.

Once I disabled the name AutoCorrect, Access quit rewriting my
query.

Thanks x10!

Andrew

Somebody here refers to it as name AutoCorrupt. That person please
take a bow.

Glad to have helped.
--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.