Are you looking for something like this:
01/12/2007 test1 test1
15/02/2008 324234 324234
15/02/2008 simth 999
15/02/2008 asasas asasas
or do you just want the lines to disappear? I don't see any way for the lines to disappear, but to list the three fields with a space or two between them would be to just concatenate the fields together in the query with a space or two between the fields.
I would do as GolferGuy suggest, it might be possible to use vbTab as the concatenate, but I don't believe it works in SQL directly, you would have to integrate the rowsource of your dropdown list in with VBA in order to produce a vbTab in between columns - however, one other thing to watch out for is if a field has the potential to be 5 characters in one record and 25 in another, then the tabs won't line up properly, so this isn't necessarily a clean solution, though with only using spaces, the columns won't line up anyways.
rolaaus,
Thank you for the idea. Rather than using tabs, which I'm thinking would not work. It's too logical, therefore Microsoft will not allow it. But, by defining the font for the list box to be Courier (where every character takes the same space), then blanks can be used to fill in the spaces and they will come out even. And, even if one field is too long, this method I'm about to show will take care of that.
This would be in the query that feeds the List Box for the entries that will be visible. What I have shown here would be the first field (Field1) would be 23 characters long with 2 spaces before the next column. Field2 would be 10 characters wide with a 2 space gap before Field3 which would be 15 spaces wide. Actually, you would not have to truncate the last column of data because that would be taken care of by the list box itself.
Hope this helps, and again Rolaaus, thanks for the brain storming help!
your note about courier being monospace is brilliant
i have real problems trying to line up data in columns in a msgbox, because of proprotional sized fonts - i'll try courier
gooroo
do you think your wasting too much time on this - its probably useful to your users to see a dividing line - eg, what happens if your columns arent wide enough to accomodate all the data
- without column dividers the columns will just run into each other
gemma-the-husky,
I think you missed the idea behind the concatenation that I showed. Each column is cut off at a certain number of characters. There will be no running into the next column. But, some data sure might not been seen. And the way Access does a list box is that it truncates data that is too long to fit in a column. Same thing my code does. It just might be less data because Courier uses more space for the same number of characters than most other fonts.
Thanks about the "brilliant" comment. It's sort of like playing golf. One good shot, which was luck anyway, brings you back the next time.
Doing the spacing (fixed-width or otherwise) sort of defeats the purpose of the listbox if you want to do anything beyond look at the data. Most of the functionality of the listbox disappears (sorting on column 3 for example).
If you don't mind the poor man's way around this, set the back color of the listbox to 12632256 (the lightest gray in the default color palette). This is the same color as the dividers, thereby making the lines "disappear" as it were.
I'm sure there's an API call around this that I'm not thinking of, but it sounds like you're putting an awful lot of thought into what is ultimately a minor aesthetic difference of taste.
If you need to sort the stuff in the list box, then the query that is the RowSource can identify those fields as sort fields. If you need access to that data as one of the columns in the list box, then include them as columns that are set to a width of 0" and you can still get to the column. But, if you want as much data as will fit in the space given, and the lightest gray in the default color palette works for you, that is a good way to go.