Select Distiinct

F

Frank Situmorang

Hello,

I tried to find in the help or keywords, I have not found the " select
distinct". Can anyone explain the difference between, " Select" and" select
distinct"

Thanks in advance
 
R

Rob Parker

Select Distinct eliminates all duplicates from the query. If you have more
than one field in the Select clause, it will limit the combination of all
fields, not merely the first field in the Select clause.

It's commonly used as the RowSource for a combobox, to list existing entries
without duplicates. For example, if you have an inventory table which
contains a Supplier field, and you want a combobox for users to select
existing suppliers (or add a new one, if you don't set Limit To List to
Yes), then you could use:
SELECT DISTINCT Supplier FROM tblInventory;
as the RowSource for the combobox.

HTH,

Rob
 
F

Frank Situmorang

Thanks Rob for your explanation, because I am trying to solve my problem of
using find in my form using combobox, but when finds the record, some of the
related table field in my form showing " #Name", I do not know how to solve
the problem all the link in my query is already OK, but how come the adresss
and the calculated field in the grid query to produce full name is also
showing #Name in my form

I appreciate if you could explain on this

Thanks a lot
 
R

Rob Parker

I don't fully understand exactly what you've got a problem with here.
However, a very common cause of #Name errors in textbox controls on a form
is that the name of the control is the same as the name of a field in the
form's recordsource, AND the control is not bound to that field.

Please post the SQL of the query which is the Record Source of your form,
and the name(s) and expression(s) (ie. what appears in the Control Source
field for the control) of the controls on your form which are showing this
error.

Rob
 
F

Frank Situmorang

Thanks Rob for all your explanations, I found what goes wrong is that the
name of my query is 2 word " BukuAngKby Query".... so this is against the
naming rule, and when I correct it to combine into one word and correct the
all related VBA, my form now is OK

The name of the Table is "BukuAngKBY" some fields with "#name" wchis are
from query ( another table in query)

Again, thanks very much.
 
R

Rob Parker

Glad that you've got it solved!

Rob

Frank Situmorang said:
Thanks Rob for all your explanations, I found what goes wrong is that the
name of my query is 2 word " BukuAngKby Query".... so this is against the
naming rule, and when I correct it to combine into one word and correct
the
all related VBA, my form now is OK

The name of the Table is "BukuAngKBY" some fields with "#name" wchis are
from query ( another table in query)

Again, thanks very much.
 
Top