Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old November 12th, 2005, 11:38 PM
David Savageau
Guest
 
Posts: n/a
Default Combo-Box Problem.

Can anyone help with the following problem? The solution will likely
be elementary to many members of this newsgroup, but, Duh! I've been
struggling to find it all day.

On an Access 2000 form I'm designing, there is a combo-box for the
names of 535 Members of Congress. The Recordsource is a table. The
Autoexpand property is on. When I enter the first few letters of the
last name, the field fills beautifully.

My problem: How can I include additional information - such as phone
number and congressional district - from the underlying table either
in the combo box or as separate fields on the form? I've spent hours
with reference books on this. Any ideas?
  #2  
Old November 12th, 2005, 11:38 PM
Bob Quintal
Guest
 
Posts: n/a
Default Re: Combo-Box Problem.

david.savageau@verizon.net (David Savageau) wrote in
news:b2eda727.0405081311.5359821c@posting.google.c om:
[color=blue]
> Can anyone help with the following problem? The solution will
> likely be elementary to many members of this newsgroup, but,
> Duh! I've been struggling to find it all day.
>
> On an Access 2000 form I'm designing, there is a combo-box for
> the names of 535 Members of Congress. The Recordsource is a
> table. The Autoexpand property is on. When I enter the first
> few letters of the last name, the field fills beautifully.
>
> My problem: How can I include additional information - such as
> phone number and congressional district - from the underlying
> table either in the combo box or as separate fields on the
> form? I've spent hours with reference books on this. Any
> ideas?
>[/color]
This is so simple. Use the combobox wizard.

If you want to do it manually, look at the combobox properties,
specifically the ones named column count, column widths and
rowsource.

BTW,

Bob Quintal
  #3  
Old November 12th, 2005, 11:39 PM
James Fortune
Guest
 
Posts: n/a
Default Re: Combo-Box Problem.

david.savageau@verizon.net (David Savageau) wrote in message news:<b2eda727.0405081311.5359821c@posting.google. com>...[color=blue]
> Can anyone help with the following problem? The solution will likely
> be elementary to many members of this newsgroup, but, Duh! I've been
> struggling to find it all day.
>
> On an Access 2000 form I'm designing, there is a combo-box for the
> names of 535 Members of Congress. The Recordsource is a table. The
> Autoexpand property is on. When I enter the first few letters of the
> last name, the field fills beautifully.
>
> My problem: How can I include additional information - such as phone
> number and congressional district - from the underlying table either
> in the combo box or as separate fields on the form? I've spent hours
> with reference books on this. Any ideas?[/color]

There have been recent posts about this very topic. You need to
choose whether to use bound or unbound controls on the form. Since it
seems you only need to view the information there's not much
difference in the effort required to do either. For unbound, open a
recordset with a SQL string that finds the congressperson listed in
the combobox and assign the values to the unbound textboxes on the
form. A good place to put this code is in the AfterUpdate Event of
the combobox. The assignment looks something like txtDistrict.Value =
MyRS("District"). Most people in this NG would use a combobox with
two fields (columncount = 2) having the second field as the bound
column and the Primary Key of tblCongressMembers as the first field.
The ColumnWidths would look something like 0";3.5" to hide the Primary
Key. Then the SQL string could use the combobox.Column(0) value to
look up the correct congressperson using the Primary Key. Many people
in this NG prefer the bound approach. It does have some advantages,
particularly of binding people to Microsoft :-). Seriously, binding
the values using the RecordSource of the form can often be implemented
using less code but the more the tables get bound to forms the more
likely it is that you will run into conflicts when updating values.
Access is fully capable of handling both techniques. I'll let a
stronger proponent of bound controls explain their position if you
don't find what you need from recent posts.

James A. Fortune

I pay my employees just enough so they don't quit. The problem
is they do just enough so they don't get fired.
--- Tire Store Manager
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles