Listbox columns

I have an access form with a Microsoft Forms 2.0 Listbox which I defined to 
have four columns.  I am unable to add any item to anywhere apart from the 
first column.

    Listbox7.additem callnum                             ......works fine 
adds to the first column
    Listbox7.column(1).additem    callnum         ...... fails and I 
expected it to add to the second column

Can anyone help with the method of adding data to the Listbox columns.


Many thanks
ST 


0
SteveT
8/21/2007 11:16:56 AM
access.formscoding 7493 articles. 0 followers. Follow

2 Replies
1388 Views

Similar Articles

[PageSpeed] 57

First of all, why are you using the Forms 2.0 listbox? What's wrong with the 
one that's built into Access that you're not using it?

AddItem is intended to add the entire row at once. Concatenate the values 
using semi-colons:

Listbox7.AddItem "Column1;Column2;Column3;Column4"

(remember that the RowSource is always a string, even if you're dealing with 
numeric data)

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"SteveT" <nospam@nospam> wrote in message 
news:48adneub_YQ3VFfbnZ2dnUVZ8sKlnZ2d@bt.com...
>I have an access form with a Microsoft Forms 2.0 Listbox which I defined to 
>have four columns.  I am unable to add any item to anywhere apart from the 
>first column.
>
>    Listbox7.additem callnum                             ......works fine 
> adds to the first column
>    Listbox7.column(1).additem    callnum         ...... fails and I 
> expected it to add to the second column
>
> Can anyone help with the method of adding data to the Listbox columns.
>
>
> Many thanks
> ST
> 


0
Douglas
8/21/2007 11:36:03 AM
Many thanks...
The part developed form was inherited from another person and I thought the 
Forms 2.0 listbox with columns was there  as part of some grand master 
scheme.  It appears not so will revert to keeping it simple and sane!



"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message 
news:uQTj1d%234HHA.2752@TK2MSFTNGP06.phx.gbl...
> First of all, why are you using the Forms 2.0 listbox? What's wrong with 
> the one that's built into Access that you're not using it?
>
> AddItem is intended to add the entire row at once. Concatenate the values 
> using semi-colons:
>
> Listbox7.AddItem "Column1;Column2;Column3;Column4"
>
> (remember that the RowSource is always a string, even if you're dealing 
> with numeric data)
>
> -- 
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
>
>
> "SteveT" <nospam@nospam> wrote in message 
> news:48adneub_YQ3VFfbnZ2dnUVZ8sKlnZ2d@bt.com...
>>I have an access form with a Microsoft Forms 2.0 Listbox which I defined 
>>to have four columns.  I am unable to add any item to anywhere apart from 
>>the first column.
>>
>>    Listbox7.additem callnum                             ......works fine 
>> adds to the first column
>>    Listbox7.column(1).additem    callnum         ...... fails and I 
>> expected it to add to the second column
>>
>> Can anyone help with the method of adding data to the Listbox columns.
>>
>>
>> Many thanks
>> ST
>>
>
> 


0
SteveT
8/22/2007 9:29:01 PM
Reply:

Similar Artilces:

scrollbar listbox
i'm trying to get rid of the horizontal scrollbar in listbox is it even possible to do that? tia jocke --- Message posted from http://www.ExcelForum.com/ ...

filter a listbox
Hi, i have made a form where i have 4 combolistbox (named: BOX1, BOX2, BOX3, BOX4) and a listbox (Named: LIST1, it is based on a table). i want to filter the data in the listbox by selecting some filter criteria in one of the 4 combolistboxes. i have tried to find out what to do, but i can't make anything of the solutions to work. I hope someone can help me with my problem. David, Why not base your listbox on a query. Within the query you can reference the comboboxes. In the after update of the combobox you can place a me.listbox.requery which will requery the source of the listbo...

ListBox
On my form I have a combobox with a value list. After I make my selection I would like to run a query (after_update) and have it populate a list box? Is this possible and how? The query is simple and will only select one field from my table with about 20 records. Then is it possible to select certian values in this list box (may CTRL Click the ones I want) and then have a report print out based on what I selected in the list box with other selection on my form? Thanks, Sean, In the combo's AfterUpdate event, you need to add code to set the listbox's RowSource property. ...

Hiding/Unhiding Columns
Good Morning All, Using Excel XP. I have a spreadsheet that has columns A to AJ which has F, X, Y, Z that are hidden. I have a macro that unhides columns A to AJ and brings me down to the first blank row in column A. After entering data I want to run a macro that hides columns F, X. Y, Z again. The macro that I made up hides X,Y,Z but leaves me at column K (not A) to AJ. Somehow it hides A to J, which I don't want to do. Thank you in advance for any help in this situation, Michael try this to toggle hidden/unhidden. Sub togglecol() Range("f1,x1:z1").EntireColumn.Hidden...

listbox inconsistencies
I am a relatively new VBA user and this is my first post to this forum. I am using Excel 2002 sp3 with VBA (help shows VB 6.03 version 1024) on an XP sp3 machine. I have a project with one workbook that has one form - frmRecordJob. This form has a calendar control, a combo box, 2 listboxes, some labels, and 2 text boxes. The 2 list boxes (lstCode1 and lstCode2) are in a frame. lstCode2 was created by copy/paste from lstCode1. Checking their properties shows them to be identical except for the tab indices and top properties. The value and text properties are both empty, with no...

Getting column width sizes
Using Excel 2000. I hope I can explain this well enough, so here goes. I have a 4 column chart: !candidate!prec. 1!prec. 2!total! !Joe Smith!10!10!20! !Jane Doe!15!15!30 Someone posted the following code which calculates the width of a selected cell in points: Sub CalcWidth() W = Selection.Width MsgBox W End Sub What I'm trying to do: I'm converting worksheets into charts for an editorial layout system, but I just need a way to easily get those numbers. I need the macro to go to each cell in the selected range, get the width and insert those numbers in the A1 cell, separated...

Sum of columns with certain text value in another column
How can I sum columns in a cell, at the bottom of the page, of values in column "F", if the value in column "G" is a certain text? ...

Move data between ListBoxes
I created a UserForm with two list boxes (ListBox1 & ListBox2). Right now when I show the Form ListBox1 is the only ListBox with choices inside of it. The problem I am having is that I’d like to be to be able to double click a selection from ListBox1 and have it be moved over to ListBox2. Similarly, I would like to be able to double click a selection after I have moved it to ListBox2 and have it be move back over to ListBox1. Can you help me develop the code that will perform the procedure I am trying to add to this form? see if this helps http://www.dailydose...

Listbox to control listbox
I have a list box with all phone numbers in it. I would like to be able to filter the listbox phone numbers by category. In other programs, I have seen two listboxes side by side and one be clickable to filter the results of the other listbox. How can I accomplish this result? Any suggestions on this would be helpful. NDClark wrote: > In other programs, I have seen two listboxes side by side and one be > clickable to filter the results of the other listbox. How can I accomplish > this result? You need: 2 tables: one containing the categories and on...

column headers
I would like to know how to rename the column headers (A, B, C) to reflect the information contained in the column. Is this possible to do? Thanks in advance for any help. One way You can use windows -Freeze Panes in the menubar To freeze the first column and Row. Select cell b2 and do windows -Freeze Panes You can put your own headers in the first row and column then Under Tools -options -View uncheck row & column headers so the default row and column headers are gone You can also freeze the first row only, select b1 then -- Regards Ron de Bruin (Win XP Pro SP-1 XL2002 SP-2...

help organizing columns
I am using Access 2000. i have made a table with three columns, one which has the date. I have a 3rd party application that automaticly writes to this table i have made everyday. How can i keep my data sorted starting with current date descending to the last one. write now it seems to just go where it pleases. thankyou in advance. Also I forgot to mention that i am using another program i have made in VB that connects to the data base as well and needs the date descending also. Records in tables are like marbles in a bag. Don't expect any order. If you want your records sorted into ...

CListView: Insert Table header above column headers
Hi all, I have got a CListView derived class with style LVS_REPORT. All is fine and I can set column headers / data rows too. However there is a peculiar requirement to show one single cell row before the column header row which functions like a table header. Please suggest some way by which I can insert a row before column header. It needs to look this way, Figure below looks correct only in Monospaced font (courier / courier new). I wan to insert the column header as marked by ***** in the figure. Please help. Thanks in advace. Best regards, Mandar ------------------------------ | ...

Populate a comboxbox and Listbox in a excel userform with an sql table data
Hi All, I have a excel userform which has some combo boxes and list boxes and I want to populate this boxes with the data which I have on my sql server database tables. Just to give an example. My first combo box is for region which needs to be populated from a sql table called Region_Mapping and my first list box should be linked to the same sql table but it should populate the countries on the basis of the region which user will select in the combo box. For eg : In my sql table I have following countries which are mapped against America 1) Argentina 2) Brazil 3) Mexico 4) Canada...

compare 2 columns
Hi all, Can some one help me for my following question? I have some data in column A, and some in column C. For example, Column A 1 2 3 4 5 6 7 8 9 10 Column C 2 4 5 6 7 Now, I want to compare A2:A11 against C2:C6. Here is the question: If a number in column A do not exist in column C, enter that in Column B; otherwise if column A number exist in column C, do nothing or leave it blank. Like 1,3,8,9,10 do not exist in column C, so they should appear in column B. Thank you for your help. sndesai74@gmail.com wrote: > Hi all, > > Can some one help me for my following question...

linking multikple columns to one column in a differ table
I have a form where 9 different names (there are over 150 names) are entered into 1 record. Each name would have a date and a memo box associtated with it. Each name is associated with a different team (there are over 20 teams). I would like to have a query where you would be able to pick a team and have only the information contain to that team appear. The end result I am looking for is a report that looks like this: Team Name, Date, memo Name, Date, memo so and so on I am a newbie so I need detailed instructions. Thanks in advance You might need to show us how some of the da...

Vary column width and row height in the same worksheet
In Word, I can create two tables with different column width, then remove line to combine the two tables together. Can I achieve the same different column width and row height in the same worksheet? Either one on top of the other, or side by side?!! In XL, height and width are properties of entire rows and columns, so you can't achieve what you're looking for exactly. There are workarounds. Among them: - you can merge cells so that they appear to be wider/taller than their surrounding rows/columns. I don't recommend this as merged cells typically interfere with formattin...

ListBox
Hi, I am trying to create one customized ListBox. 1) I have one CStatic as ListBox container and it holds one ListBox which is object of CListBox and one customized ScrollBar. 2) The picture is like, when I click on one button (which is on a dialog) , list box appears. 3) I also have some other controls on the same dialog. Now my problem is whenever I click on the portion of listbox which is overlapping with other controls it gets hide. omkar.parkhi@gmail.com wrote: > Hi, > I am trying to create one customized ListBox. > 1) I have one CStatic as ListBox container an...

Excel columns problem
I'm trying to create a phone book for company. The delimited data comes in an Excel file which converts to 1500 rows of 3 columns. I copied into Word and used the newspaper columns feature to place 2 sets of columns of data side-by-side. Except, Word chokes when it tries to distill this to PDF. And, what pages actually display in PDF appear too slowly. I watch one column of data display downward, and then the next, and so forth. Users won't wait that long to find a phone number. I also tried copying the Word newspaper columns back into Excel but ended up with one set of 3 columns of da...

Merging columns
Hi all, I have got 3 columns with the column headings as follows Column : A B C Firstname Fathersname Mothersname Jim Jack Mary Raj Rani Susan John Diana The desired output is given below Column D E Jim Jack Jim Mary Raj Rani Susan John Susan Diana The logic should be in case if a pe...

How to get out of a listbox?
Hi! Need a little help please. Question, how do I terminate/close the listbox after the user made one selection? My code filling up a the listbox and calling a Userform1 Thank's ahead for any pointers. Sub slist() i = 1 For Each ws In Worksheets UserForm1.ListBox1.AddItem (Worksheets(i).Name) i = i + 1 Next ws UserForm1.Show End Sub Userform1 code:---------------------------------------- Private Sub ListBox1_Click() Sheets(UserForm1.ListBox1.Value).Select End Sub Not sure I have got the problem, but maybe try Sub slist() i = 1 Userform1.Listbox1.Clear For Each ws In Wor...

Automatically copy formula in column when adding new row....
Hello all. Sorry if I am posting this question in the wrong category, but this is my first post here. I am using Excel 2007, and I am trying to automatically copy a formula that's in a column when I add a new row. I'll explain a little more in detail what I am hoping to achieve. My spreadsheet is intended to show profit and loss for my sales. Columns A:W all have details specific to the products that I am selling, including original purchase price, sale price, shipping, fees, etc... In Column X, I have this formula " =SUM(Q4:W4)*L4 ", and then in Column ...

Creating a stacked column graph
Guys Am looking to create a stacked column graph. Can someone help me with this. Am attaching an excel spreadsheet with the required columns in it. My requirement is:: Add a stacked column graph with build value on the horizontal axis and volume on the vertical. Collapse data points into:Closed (3 closed status values), New, In Progress (In Progress + Ready for Build + Ready for Release), Ready for Test. Split the columns by severity. Please help me with this one.How to go about creating this graph and how can i insert the values into X,Y and Z axis. Thanks Sri I will need step by step i...

How to check the whole column at the same time?
Hi all, Could anyone help me how to check the column content by different condition? If the content of the cell is "Father" then replace it to "1" in the same column. If the content of the other cell is "Mother" then replace it to "2" in same column. If the content of another cell is "Sister" then replace it to "3" in the same column. Besides, how can I implement this checking by using Marco? Thanks, Tlee The simplest option for one-off changes is to use search and replace. Select the entire column and use the search-replac...

Adding a second line on a two axis column stacked chart
I have a stacked bar graph showing 4 data series on the x- axis with a line showing 1 data series on the secondary x-axis. Now I want to add a second line to the secondary axis When I do so it automatically becomes a bar instead of a line, regardless which axis I am plotting it on. Is there anyone out there that knows what I am doing wrong and/or what the trick is ? The trick is this: Don't use the "built-in custom" chart types, but make your own. Make your chart with all series as stacked columns, then select each one you want to change, and use Chart Type on the Ch...

sorting a listbox
Hi, I have a listbox on a form dependant on a query called Projects. The listbox contains 6 columns and I have put 6 labels about each column which describes it and there is no set number of rows that will be displayed in the listbox. What I want to do is be able to sort the columns whenever the user clicks on the label name. I tried doing this with the macro builder but that didn't seem to work and I am only a beginner with VBA so I don't even know where to start. Thanks! Hi, would like to post the SQL string for the query Projects and the names of the 6 labels, then we could do...