|
-
Nov 16th, 2000, 07:24 PM
#1
Thread Starter
Fanatic Member
OK here is my question:
If you wanted to fill the contents of two different fields into one combo box how would you do it? Example:
One field called email, the other one called email_address.
Combo box called cboemail
Could you place the email field next to the email_address in the combo box. So in other words the email field would match the name to the actual persons email address.
-
Nov 17th, 2000, 07:32 AM
#2
Lively Member
Is this what you are after? Using an unbound combo box control.
Code:
Dim rcsTest as recordset
Dim SQLStatement as string
SQLStatement = "Select [email], [email_address] from [Table]....."
Set rcsTest = YourDB.OpenRecordset(SQLStatement)
with rcsTest
if (not .BOF) and (not .EOF) then .MoveFirst
Do While Not .EOF
cboemail.additem ![email] & chr(9) & [email_address]
.movenext
loop
.close
end with
Or have I missed the point?
Adrian.
-
Nov 17th, 2000, 10:05 AM
#3
Thread Starter
Fanatic Member
That should work, I changed the names of the fields to the actual ones that I use but I get external name not defined, compile error. It is saying that it does not know what I am trying to refer to. Any suggestions?
-
Nov 17th, 2000, 10:42 AM
#4
Thread Starter
Fanatic Member
It breask on:
cboemail.AddItem ![Name] & Chr(9) & [email_addrs].
-
Nov 17th, 2000, 11:30 AM
#5
Fanatic Member
You have missed out ! in fornt of [email_adrs]
Cheers,
P.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Nov 17th, 2000, 11:50 AM
#6
Thread Starter
Fanatic Member
Thats not or I am not getting it....
-
Nov 17th, 2000, 01:22 PM
#7
Thread Starter
Fanatic Member
-
Nov 17th, 2000, 01:51 PM
#8
Thread Starter
Fanatic Member
OK I kind of got it but how do I have it fill on the same line as the address.
Example it is coming up like this
[email protected]
Brian Hratline
I want it to look like
[email protected] - Brian Hartline
-
Nov 18th, 2000, 08:34 AM
#9
Lively Member
How about cboemail.additem ![Name] & " - " & ![email addrs]
Adrian.
-
Nov 18th, 2000, 06:25 PM
#10
Hyperactive Member
You can use Space function:
cboemail.AddItem ![Name] & Space(5) & ![email_addrs]
or
cboemail.AddItem ![Name] & " " & ![email_addrs]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|