473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Putting three list boxes once selected into one column

Hi,
Just joined, am looking for some expert advice and hoping I can get it from here.
I have a MS Access 2003 database with several tables, queries, forms etc.
My question is I have a simple form which has 5 boxes on it listing information from tables and queries. One of the boxes is linked to a lookup where I can get it to dispaly three values but once the user selects which one they want it only displays the first value. I want it to display all three under the one column so to speak. The Lookup lists Order, Forenames and Surname but only lists the Order when selected. Is there any way I can get all three values under the one column rather than having to put three boxes with three lookup's and then the user having to do it three times to get the information?
Grateful for any advice
thanks
Dec 2 '11 #1

✓ answered by Phil Maskell

Thanks for your response, having finally 'cracked' it, you can do it in a query, I have created an expression drawing the fields from the table, i.e.
Expand|Select|Wrap|Line Numbers
  1. Expr1: [Person Details]!Order & [Person Details]!Forenames & [Person Details]!Surname
Thanks for the responses

5 1439
sierra7
446 Expert 256MB
Hi Phil,
You need to create a query which includes the three fields and use this as the basis of your RowSource for the combo. You can either build the query in the combo or save a query and give it a name then enter the name as the Rowsource.

To display three columns you must set the ColumnCount to 3, set the widths, try "2;2;2cms" to start with, then set the total Width from Auto to 6cms.

There are issues with Bound Column and whether you need hidden columns (where width =0) but this should get you started.

Have fun!
S7
Dec 2 '11 #2
Have created a query which gives the 158 records in three columns titled Order, Forename and Surname, that works great and lists all the details. My problem is when I use that query in the form, I want those three fields from a drop down to automatically be inserted once selected. e.g. Order, Forename, Surname, user selects and then all three bits of information from the three columns is filled in. At the moment my form has 5 fields on it Order (which has the three drop downs) Date Attended and Date Next due, once the user selects the drop down it is only putting the Order number in and not all the information. Any clearer?
Dec 2 '11 #3
NeoPa
32,556 Expert Mod 16PB
Ah, I was afraid this might be what you were after when I answered your other thread. This question is sufficiently different to be allowed as a separate question, but nevertheless I believe keeping it all together may have made things a little clearer and easier to deal with. No matter.

Only one column can be bound to the control. As such, unless you create a query where all three values are joined together into a single string value, it is not possible to return all values in a single control. It is possible, using .Columns() and some VBA code, to populate other controls on your form whenever an update (selection) is made to the ComboBox.

However, and this is a very big however, it seems that what you are attempting to do is contrary to Normalised Database theory, and as such is strongly advised against. Check out this very important and seminal subject for databases (Database Normalisation and Table structures). I cannot express how important such an understanding is to doing anything worthwhile with databases.

In a normalised database you would expect to store only a link to the record of the other table in the one being maintained. It is almost never a good idea to copy such data across en masse.
Dec 3 '11 #4
Thanks for your response, having finally 'cracked' it, you can do it in a query, I have created an expression drawing the fields from the table, i.e.
Expand|Select|Wrap|Line Numbers
  1. Expr1: [Person Details]!Order & [Person Details]!Forenames & [Person Details]!Surname
Thanks for the responses
Dec 5 '11 #5
NeoPa
32,556 Expert Mod 16PB
Spaces in there would make it more recognisable, but we don't know your exact requirement so what you have may be adequate. The important things is that you have what you need :-)
Dec 5 '11 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Lamine Darbouche | last post by:
Can anybody help? I need to have three list boxes automatically populating each other, (ie when region is selected from the first listbox, it will populate automatically the second one which is...
2
by: Ellen Manning | last post by:
I'm developing an A2K adp that contains doctor info and the months they are not available for teaching. A doctor can be unavailable for some months for one year and other months for another year. ...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
1
by: Stephene | last post by:
New to the world of web design/php/mysql and need help please. What I'm trying to do: I would like a web page with three drop down menus each populated by a query The first represents...
7
by: ljungers | last post by:
Have Form-1 with 3 text boxes and 1 command button. With any of the 3 boxes filled out and button is clicked, a Macro is performed that Opens a Query that has a WHERE clause that uses the 3 test...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
7
by: Clamato | last post by:
Hello everyone, I've been working on this for a bit and wonder if anyone can shed some light on my situation. My ultimate goal is to have a user select an item in a list box, have one column in...
12
by: micarl | last post by:
How would i print a report based on criteria selected from several Combo Boxes as well as multiple Multi Select List Boxes, that are located on the same form? I can get one Multi List Box, just...
2
by: hollinshead | last post by:
hi there, i have been having this issue for quite some time now and i cant seem to get my head around it. I am trying to create a database for candidates CV's and covering letters. basically the data...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.