473,385 Members | 2,069 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,385 software developers and data experts.

How to show all available items in combobox?

4
Hello! I'm using Access 2010. I've created a combobox that "finds a record" based on a selection, the selection choice being client last name. It works fine, BUT, I have about 90 names on the list, and although I've increased the "List Rows" value to 90, I get one column that I have to scroll through, as 90 rows don't fit on the screen. What I want to do is pop up a list of all the names, all visible, which would presumably mean 3 columns of 30 (since 30 rows fit on the screen), so I can get to any name in 2 clicks with no scrolling. My list will never get significantly longer than this, so there is no danger of someday having 1000 names on the screen. Lots of searching keeps bringing me to info on showing multiple columns each with a different field, but I've found nothing about "wrapping" a single field list into multiple columns.

Thanks in advance!
Dec 5 '13 #1

✓ answered by zmbd

Well Tom:

I think we've hit the limit here:

Option1)
With the CBO as is:
format tab: list rows = # 1 to 255 == I generally set this to 20 as most of my PCs in the lab have large monitors.
data tab: auto expand = yes == this allows the box to start filling in as you type.

2) ADezii's method with the string building code and collary with the command button

3) A customized form

4) If there is a third part control, install and use.
(BTW: If there is a third party opensource/freeware/shareware - we'd like to know.
A commercial product that could potientially help please PM me prior to posting within the thread so that we make sure that the post meets the forum guidelines.

Best of Luck
-z

11 5065
zmbd
5,501 Expert Mod 4TB
For ACC2010 and older: Column wrapping, can not be done with the current default control.
As far as I've seen in ACC2013, this still hold true.

Thus, to the best of my knowledge, you are out of luck, unless there is a third party control, an activex, or an API call that I am unware of.
Dec 5 '13 #2
TomDDS
4
Thank you zmbd. Given that, are there any other ideas for how to accomplish my goal? I have a "master listing" split form, with client details on the top, and the datasheet on the bottom (or the side, depending on circumstances). I have been scrolling through the datasheet to select the client I want tosee detials on. The current combobox is better, becuase I can see more names at once than on the datasheet, so there is less scrolling. This is nothing mission-critical; I was just hoping to make that last last leap to "click-click" and the record details appear. Thansk again!
Dec 5 '13 #3
zmbd
5,501 Expert Mod 4TB
Hmm...
Personally, I would have the parent form be the client and then the child form be the details for the selected client.

IE: In the lab: Parent form is linked to Internal/External customers. The child form is linked via the customer_pk/fk related fields, thus the subform shows only the records from the sample table related to that customer. I have a toggle on the subform that will filter the shown records to only those samples that are "open." The child records have an on-click event that will then open the form related to samples, and so forth.
However, I also have a way to directly hunt the sample down based on ID... the samples when enterd have an ID code assigned. Using that code takes the user directly to that sample's dataentry


As for the cbo:
I usually turn "on" the autoexpand property of my cbo; thus, as I type the entry into the textbox portion, it starts to fill in.
For example, a cbo with a list my supplier company names... if I star typing in "f" then the first entry in the list starting with "f" fills, if I have drop open, then I can see the remaining "f" entries, if I type in "fi" then it fills in the first with "fi" and drops thru the list... of course this works best when the record source is sorted alphabetically.

You might also want to take a look at the links in this list. I understand they're not exactly what you have in mind; however, something here may help with a different approach:
-filtering-
Dec 5 '13 #4
ADezii
8,834 Expert 8TB
It is a lot easier to accomplish this than you would think. Let's assume that you have a Table named Products with the Product Name entered into the [ProductName] Field. Let's further assume that you have a Combo Box named cboProducts and that you wish cboProducts to disply all 90+ Products alphabetically in three Columns, 2 inches in Width each. The following Code will do just that:
Expand|Select|Wrap|Line Numbers
  1. Dim MyDB As Database
  2. Dim rst As DAO.Recordset
  3. Dim strBuild As String
  4.  
  5. Set MyDB = CurrentDb
  6. Set rst = MyDB.OpenRecordset("SELECT [ProductName] FROM [Products] ORDER BY [ProductName]", dbOpenForwardOnly)
  7.  
  8. With rst
  9.   Do While Not .EOF
  10.     strBuild = strBuild & ![ProductName] & ","
  11.       .MoveNext
  12.   Loop
  13. End With
  14.  
  15. strBuild = Left$(strBuild, Len(strBuild) - 1)
  16.  
  17. rst.Close
  18. Set rst = Nothing
  19.  
  20. With Me![cboProducts]
  21.   .RowSourceType = "Value List"
  22.   .ColumnCount = 3
  23.   .ColumnWidths = "2 in;2 in;2 in"
  24.   .RowSource = strBuild
  25. End With
Dec 5 '13 #5
TomDDS
4
Thank you ADezii. This sounds like what I want to do. Unfortunately, I'm not a "coder." I have some basic understanding of it, and have even been able to insert a few bits and pieces, but with something this size I don't even know how/where to insert it and get it working. This is not my job, I'm just hacking around with ways to make my record keeping as a social worker eaiser.

I don't expect a full tutoring session on VBA from you, and I am gratefull for the time you have given me already. I will probably take this and experiment with it at some point, since it looks so perfect for my goal, but, for now I'm likely to use the simple combobox so I can get back to my real job before the boss notes my lack of completed work.

I really do appreciate the help from you and the other poster!

@ADezii
Dec 5 '13 #6
zmbd
5,501 Expert Mod 4TB
As Always very clever ADezii!

So they're all the entries are now in the drop down list...
let's just say the letters A...Z, 1,2,3,4 to give us a nice set of thirty... and something to play with:
(using "1" reference basis)
So the letter Z is in the ninth row in the second colum.
I click on the letter z
I instead get the letter y in the combobox instead of the intended letter z.

Now what?
Dec 5 '13 #7
ADezii
8,834 Expert 8TB
  1. Immediately in the AfterUpdate() Event of the Combo Box, set its Value to NULL.
  2. Superimpose a Text Box over the Combo displayimng all three Values in the Selected Row.
  3. Prompt the User to see if they want the Value in Column(0), Column(1), or Column(2) for the Current Selection.
  4. Granted, a very unorthodox approach.
Dec 6 '13 #8
zmbd
5,501 Expert Mod 4TB
Nice idea, fairly straight forward to accomplish...

However, if we go the button route, let's toss the CBO and why not go with a 7x5 (think calendar), or 2x15, 3x10, etc... gridwork of command buttons?
The names can be read into the captions and the same returned from the click event of the selected button.
One could set the first button (A1-7x5) as page back, with the last button (G5-7x5) as the page forward and maybe a home button at B1 or F5
I've done a 5 button version very early on with a game/quiz. I don't have the code anymore, however, it seemed fairly easy at the time.
In anycase, the onlick event of the combo/text box could be set to open the form, the user selcts and the result returned.
I'd most likly do this with custom events so that when the button was clicked, RaiseEvent(withtheinformationtopass) and let the calling form deal with it, in the meantime unload the form.
What do you think?

(@TomDDS: I know, it's a tad off topic, I applogise, the answer to the OP still appears to be "no - not at this time" yet we're trying to find you a workaround (^-^) )
Dec 6 '13 #9
ADezii
8,834 Expert 8TB
Nice approach, but the skill set of the OP would not warrant it.
Dec 6 '13 #10
zmbd
5,501 Expert Mod 4TB
Well Tom:

I think we've hit the limit here:

Option1)
With the CBO as is:
format tab: list rows = # 1 to 255 == I generally set this to 20 as most of my PCs in the lab have large monitors.
data tab: auto expand = yes == this allows the box to start filling in as you type.

2) ADezii's method with the string building code and collary with the command button

3) A customized form

4) If there is a third part control, install and use.
(BTW: If there is a third party opensource/freeware/shareware - we'd like to know.
A commercial product that could potientially help please PM me prior to posting within the thread so that we make sure that the post meets the forum guidelines.

Best of Luck
-z
Dec 6 '13 #11
TomDDS
4
@zmbd
LOL, no apology necessary. I got just enough of it to appreciate it. (I am a computer geek, just not real experienced with Access). I enjoyed the creative convolution :-) I'm feeling rather pleased with myself at having sparked an interesting little exchange :-)
Dec 9 '13 #12

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

Similar topics

2
by: Tark Siala | last post by:
hi in VB6 (Listbox and Combobox) have nice Properties called (Item Data) when i go to VB.NET i can't Find this Properties :( please help me , i want Save tow value in one item in ComboBox 1 -...
3
by: Don | last post by:
Hi: I want to limit the values that can be entered for particular attributes. 1) I have created an XSD from my XML document. 2) I dropped that XSD file into the following directory...
2
by: Rich | last post by:
All of my efforts to add items to display in the combobox fail; I've added items using the IDE in VS2003 (String Collection Editor) or programtically and all I get is an empty drop down list that...
1
by: Filip De Backer | last post by:
Hi, I've got a datalist with 5 labels and 5 textboxes. I get data from a database and fill in the textboxes. When there is no data I want to check on it and make the labels invisible or...
0
by: jodyxha | last post by:
HI Does anybody know a function with which i can see the amount of available memory on the heap? I use g++ on linux. Thank you Jody
0
by: lsharva | last post by:
Actually, i m working on Windows Application where i have to use the ComboBox and listview in a way , as first we will click the comboBox and then as you click , ListView appear and when we...
6
by: Ryno Bower | last post by:
Hello. I want to integrate roles and permissions for a specific operator after they log in. Is there a way to handle this. If so please ldt me know and ill give more details. Please answer. Thanks....
1
by: accessbeginerry | last post by:
I have two comboboxes which are generated by queries from mysql. When user choose value in first combobox i need to display second combobox, but if nothing is choosen second combox should not be...
4
by: Suny | last post by:
Hello everybody ... I have a gridview that display data from SQL table using the Configure data source with where clause to show data based on 2 Dropdown list It works fine and the data...
1
by: shabzo | last post by:
I have a table called Vitals with the following fields. Id(PK),PatientID,ConsultDate,Dependents(type combobox) I then have a table called Dependents with the field ID(PK),PatientID,Dependents,etc...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.