Combo boxes

  • Thread starter Lori''s Little Secret
  • Start date
L

Lori''s Little Secret

I know that I am not an idiot and I have done it before, but I can't remember
and it is driving me crazy!! I have a subform where I am trying to make a
combo box that looks up something from another table. It has 4 columns to
it, ID, first name, last name and rate. How in the hairy heck do I make it
show all those columns when I chose it off my choices. Right now, it only
shows the one column (the first name since I know how to hide the key
column). Help...I am going insane (short trip) and it is going to bug me
until I figure it out. Thanks!!!
 
I

idtjes3

I believe you have to set your column count in the table to, in this case, 4.
then, on your form, set the column count to 4 also. You can specify the width
of each column or leave it blank. I think leaving it blank sets the column to
" Best Fit". hope that helps.
 
P

Pat Hartman

The short answer is you can't. When closed, the combo will only show the
first visible column. When I want more data to be visible, I create an
expression in the rowsource query to concatenate the fields that I want to
stay visible.

Select EmployeeID, FirstName & " " & LastName As FullName
From tblEmployee
Order by FirstName & " " & LastName;
 
J

Jeff Boyce

The combobox will only show the first non-0-width field.

But you could add unbound text boxes on the form and fill them with the
..Column(2), .Column(3), ... values in the AfterUpdate event of that combo
box.

Or, if your form has the room, you could use a listbox instead of a
combobox...

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
D

Douglas J. Steele

What you're describing is how the combo box works in Access: unless the box
is opened, you only see a single value, regardless of how many columns may
be associated with the combo box.
 
L

Lori''s Little Secret

Call me stupid, but where in the tabls do I set my column count....
The combo box does list 4 in it's column count, and when I click on the
arrow, it shows me all the columns, but then only one shows up when selected
 
L

Lori''s Little Secret

I know that isn't true..I've done it before....like where I select the
product and the product and it's proce show up....
 
L

Lori''s Little Secret

OKay..dummy me here again..how do I do that. I know that I have done this
before, and am not a total idiot...just having a brain drain
 
P

Pat Hartman

You may be confusing a list box with a combo. List boxes will show all
visible columns but combos only show ONE.
 
J

Jeff Boyce

In the AfterUpdate event for the combobox, you could use something like
(untested):

Me!YourFirstTextBox = Me!YourCombobox.Column(2)
Me!YourSecondTextBox = Me!YourCombobox.Column(3)
...

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
L

Lori''s Little Secret

Okay...and how do I do this. I really am an intelligent person, I promise.
For some reason I am having a serious blonde moment. ( No offense to any
blondes)
 
P

Pat Hartman

You are mistaken.

Lori''s Little Secret said:
I know that isn't true..I've done it before....like where I select the
product and the product and it's proce show up....
 
P

Pat Hartman

You were not showing the ancillary fields with the combo. You can base the
form on a query that joins the main table to the lookup table. When you
select something from the combo, Access automatically populates the fields
selected from the lookup table part of the join. If you use this method, it
is best to lock the lookup fields so that no one updates them accidentally.

I misread your most recent question. I though you were still fixated on the
multiple columns actually showing in the combo. They don't.
 
Top