Was wandering what the simple sql statement/setting is to select records from Access and if there was a field with the same value as another it would not select it.
So if your list was AABBCDDD what you select is only ABCD
Thanks for the help!
Printable View
Was wandering what the simple sql statement/setting is to select records from Access and if there was a field with the same value as another it would not select it.
So if your list was AABBCDDD what you select is only ABCD
Thanks for the help!
Try:
SELECT DISTINCT FieldName FROM TableName
Paul
Thanks a lot ill have to give it a try.
Ok, trying to test out the select method and to set a datacombo attributes and running into a problem.
The code I'm trying to use is:
Set s_list = New ADODB.Recordset
s_list.Open "select distinct state from rainfall_data", states, adOpenStatic, adLockOptimistic
txt_state.RowSource = s_list
txt_state.ListField = s_list.Fields("state")
txt_state.ReFill
It gives me an error with txt_state.RowSource = s_list saying that the rowsource method or data member is not found? huh?
I can go set it/see it when I am looking at the form so why can I not code it in?
Again, thanks for the help
I'm sorry, I can't really help with data controls and I'm not sure what the problem is that you're experiencing. You might try a new post to see if you get more replies. :(
I can assure you that
SELECT DISTINCT FieldName FROM TableName
is valid SQL though.
Good luck,
Paul
Ya i wasn't getting an problems with the SQL...I think ill try the post on the general board..thanks
As you have started with recordsets created in code, why bother with data controls. Just fill your combo using code.