Remove duplicate records in SQL

K

kidkosmo

Hi, Gang,

I need a little help with writing an SQL statment that I'm using as a
rowsource for a combo box. Below is a snippet of the logic I'm using;
however, when I'm trying to create a rowsource for the Sales Rep
option I get the Sales Rep for each record (i.e. Me, Me, Him, Him, He
who shall not be named). I want the rowsource to just show "me" or
"him" once (kinda like a crosstab query...I just don't know how to
write that in SQL).

Thanks for the help!!!

Forms!frmsearch!cboCrit = ""

Select Case (intField)

Case 3
'Search by CPU Vendor
SQLField = "SELECT tblVendors.VendorName FROM
tblVendors WHERE (((tblVendors.VendorName) Is Not Null))"
Forms!frmsearch!cboCrit.RowSourceType = "Table/Query"
Forms!frmsearch!cboCrit.RowSource = SQLField

Case 4
'Search by Interface Type
SQLField = "CPU Interface; HL7 Download; Bridge"
Forms!frmsearch!cboCrit.RowSourceType = "Value List"
Forms!frmsearch!cboCrit.RowSource = SQLField

Case 6
'Search by Sales Rep
SQLField = "SELECT tbltracking.SalesRep FROM
tbltracking WHERE (((tbltracking.SalesRep) Is Not Null))"
Forms!frmsearch!cboCrit.RowSourceType = "Table/Query"
Forms!frmsearch!cboCrit.RowSource = SQLField
 

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