[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

display colums of table in combobox

Posted on 2008-02-12
9
Medium Priority
?
828 Views
Last Modified: 2008-06-29
Combobox display info from vendor table, that contain 4 colums. When the user make a choice from combobox it display only one colum, but i want to display all 4 colums on Form?! (using Access db Form)
0
Comment
Question by:polkadot
7 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20875420
set the column count of the combo to 4
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 20875447
set the column count property of the combo to 4.
in design view of the form select the combo and hit F4

column count  4

also set the column widths accordingly
0
 
LVL 11

Expert Comment

by:TWBit
ID: 20875728
If you are talking about displaying the four columns after making the selection, the combobox will only show the first visible column.  If you want all four columns displayed after selection, you will need to change to a listbox, or add the appropriate unbound text boxes with DLookup formula.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 20875853
oops sorry, didn't read the q carefully..

you can do this using a textbox  (txtDummy) that you will place on top of the combo box. place it in such a way the only the dropdown arrow is visible

private sub combo_afterUpdate()

me.txtDummy.setfocus
me.txtDummy=me.combo.column(0) & "|" & me.combo.column(1) & "|" & me.combo.column(2)& "|" & me.combo.column(3)

end sub
0
 
LVL 11

Expert Comment

by:TWBit
ID: 20875878
much better workaround. that's thinking outside the..um..combobox!
0
 
LVL 20

Expert Comment

by:clarkscott
ID: 20876625
Set the column widths to space your column accordingly

example:
Each column is separated by   ;
column width=   1.5";2";0"

Also = set the LIST WIDTH to equal   (1.5 + 2 + 0   =)            2.5

Scott C
Scott C
0
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 20877523
Assuming that the intent here is about what's displayed after selection of a single row of the combo...
While concatenation is required to some extent (because you want to display four columns of data at once) - unless you choose to employ four *separate* textbox controls to each display the related item - using another control other than the combo isn't necessarily preferred.

i.e. you can concatenate all four columns of data into the first visible column of the combo.
However this doesn't necessarily lead itself to convenient reading for selection
i.e. you don't usually want
1 - Text1 - Date1 - Value1
2 - Txt2 -  - Value 2
3 -  -  - Value 3

Instead of
1  Text1  Date1  Value1
2  Txt2               Value2
3                        Value3

So you just employ the old technique of allow the first non-zero width column to be too narrow to be visible when dropped down.
e.g.
Rowsource:
SELECT PKID, Field1 + ", " & Field2 + ", " Field3 + ", " Field4, Field1, Field2, Field3, Field4 FROM TableName

CoumnCount:
6

ColumnWidths:
0;0.02;3;3;3;3
(assuming your columns are 3cm/inches long :-)

ListWidth:
12

Hence you have the concatenated values displayed upon selection.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
A quick solution showing how to control and open a POS Cash Register Drawer using VBA with MS Access.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question