![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I need to take information from a table, let's say one field is Agent Name and the other field is Agent e-mail address. I need a combo box with all of the agent names in there, and once I choose a name, the correct e-mail address associated with that name goes into any control that I may have on the form. I was able to write: SELECT DISTINCTROW [Query1].[Agent Name],[Query1].[Agent E-mail] FROM [Query1]; It shows me 2 columns, with the 2nd column bound it will show me both of them, and once I click the name it will insert the e-mail address. I need a little help. Thanks in advance, Raymond |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
Thanks for the response! I tried that and the only thing I did not understand was what I needed to change in the table. Do I need to add those fields with information in them? Are one of them just a primary key? Do I leave the combo box looking at the query or do I create a combo box and have it look at the table? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#5
| |||
| |||
|
|
The structure of your table needs to be the same as whay I show. If your table does not have this structure, I suggest you change your table. You can use your own table name and your own names for the fields. Your data then needs to be in this table in the proper fields. Note that AgentID is the primary key and is autonumber. For your combobox, you can either set the rowsource property to the table or you can create a query and set the rowsource property to the query. There would be two reasons for using a query: 1. To limit which Agents can be selected by using some kind of query 2. To sort the agent names alphabetically If you decide to use the query, be sure the query fields are in the same order as the fields in the table. The instructions for setting the properties for the combobox will then be the same as I provided for the table. Finally, be sure to use the correct control names in the AfterUpdate event. -- PC Datasheet Your Resource For Help With Access, Excel And Word Applications resource (AT) pcdatasheet (DOT) com www.pcdatasheet.com "Raymond Tackett" <raytackett (AT) columbus (DOT) rr.com> wrote in message news:41dd40f2$1_2 (AT) 127 (DOT) 0.0.1... Thanks for the response! I tried that and the only thing I did not understand was what I needed to change in the table. Do I need to add those fields with information in them? Are one of them just a primary key? Do I leave the combo box looking at the query or do I create a combo box and have it look at the table? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#6
| |||
| |||
|
|
The structure of your table needs to be the same as whay I show. If your table does not have this structure, I suggest you change your table. You can use your own table name and your own names for the fields. Your data then needs to be in this table in the proper fields. Note that AgentID is the primary key and is autonumber. For your combobox, you can either set the rowsource property to the table or you can create a query and set the rowsource property to the query. There would be two reasons for using a query: 1. To limit which Agents can be selected by using some kind of query 2. To sort the agent names alphabetically If you decide to use the query, be sure the query fields are in the same order as the fields in the table. The instructions for setting the properties for the combobox will then be the same as I provided for the table. Finally, be sure to use the correct control names in the AfterUpdate event. -- PC Datasheet Your Resource For Help With Access, Excel And Word Applications resource (AT) pcdatasheet (DOT) com www.pcdatasheet.com "Raymond Tackett" <raytackett (AT) columbus (DOT) rr.com> wrote in message news:41dd40f2$1_2 (AT) 127 (DOT) 0.0.1... Thanks for the response! I tried that and the only thing I did not understand was what I needed to change in the table. Do I need to add those fields with information in them? Are one of them just a primary key? Do I leave the combo box looking at the query or do I create a combo box and have it look at the table? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#7
| |||
| |||
|
|
Is there any way I could send you the database I have, and you could look at what I have. Here is the way I started to do it. It works now but I need it reversed. You may understand me better if you see it like this. I have 1 table called Badges with Fields named [Name] and [Badge] I have another table called Table1 with 1 field named [Badge Number] I created a form called Form1 from Table1 I drag over Badge Number Changed it to a combo box as a value list with the values listed below "106241";"106889";""243226";"951656" I have a text box with the following information in the control source =DLookUp("[Name]","Badges","[Badge] =" & [Forms]![Form1]![Badge Number]) The table [Badges] looks like this: Name Badge Raymond 106241 David 106889 Jason 243226 Brian 951656 It will return the name if I select the value. I just want to switch that where I select the name and it will return the badge number. PC Datasheet wrote: The structure of your table needs to be the same as whay I show. If your table does not have this structure, I suggest you change your table. You can use your own table name and your own names for the fields. Your data then needs to be in this table in the proper fields. Note that AgentID is the primary key and is autonumber. For your combobox, you can either set the rowsource property to the table or you can create a query and set the rowsource property to the query. There would be two reasons for using a query: 1. To limit which Agents can be selected by using some kind of query 2. To sort the agent names alphabetically If you decide to use the query, be sure the query fields are in the same order as the fields in the table. The instructions for setting the properties for the combobox will then be the same as I provided for the table. Finally, be sure to use the correct control names in the AfterUpdate event. -- PC Datasheet Your Resource For Help With Access, Excel And Word Applications resource (AT) pcdatasheet (DOT) com www.pcdatasheet.com "Raymond Tackett" <raytackett (AT) columbus (DOT) rr.com> wrote in message news:41dd40f2$1_2 (AT) 127 (DOT) 0.0.1... Thanks for the response! I tried that and the only thing I did not understand was what I needed to change in the table. Do I need to add those fields with information in them? Are one of them just a primary key? Do I leave the combo box looking at the query or do I create a combo box and have it look at the table? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#8
| |||
| |||
|
#9
| |||
| |||
|
|
I tried it that way and it does not work. Is there some place I could post this database, so ANYONE COULD SEE WHAT I'M DOING? I appreciate the help SO MUCH, and am following everything that is being said perfectly. |
#10
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |