A2K Strange Characters in Distinct Query/Form Reference/combo box

  • Thread starter david epsom dot com dot au
  • Start date
D

david epsom dot com dot au

SELECT DISTINCT edtdocket_switch, edt_idxRecord_2 , true as NewRecord
FROM tblDP_contracts;

This was SQL behind a combo box. edtDocket_Switch and edt_idxRecord_2 refer
to unbound controls on the form. tblDP_Contracts was a table with records
in it, used because a SELECT query needs a table with records. DISTINCT so
that the query only returns one record. ComboBox returns strange characters
in column edt_idxRecord_2. Oddly enough, at least while I was testing,
edtDocket_Switch appeared OK.

Changed the query to refer to a table which I expect to have exactly one
record, and got rid of the DISTINCT clause.

SELECT edtdocket_switch, edt_idxRecord_2 , true as NewRecord
FROM tblDP_contracts_temp;

That fixed it.

I tried this approach after seeing the suggestion regarding aggregate
queries from Ken Snell: re Strange Characters.

FWIW, note that the first three fields of those tables are
Autonumber,String,String, and none of the values in those fields were null.

Note also that (1) the original problem was with a Union Query, but I was
able to trace a problem back to one of the source queries, (2) the original
problem was with a combo box, but then it would be a combo box, wouldn't it:
it's the combo boxes that get bound to queries, and (3) No memo fields
involved, (4) although the bad data appeared to be associated with
edt_idxRecord_2, it came good with a change to the combo rowsource, not to
the text box control.

This is interesting because it's the first time I've ever been able to solve
one of these. Unfortunately, my records are not good enough for me to know
if the previous examples have involved DISTINCT, DISTINCTROW or aggregate
queries, or even to be sure that it has always been a combobox that had the
bad data.

(david)
 

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