| Chat with a LIVE Microsoft
Access Expert! |
||||
|
||||
|
#1
|
|||
|
|||
|
Subheadings visible inside the combo but not selectable!
I have seen a combo made in delphi which looks like this when the dropdon arrow is selected
STATIONS Waterloo Euston Liverpool St AIRPORTS Heathrow Stansted Gatwick only the lowercase ones are selectable. If the user selects STATIONS he gets a messagebox telling him its only a heading and unselectable. The row source for this info (in delphi) is STATIONS:Waterloo;Euston;Liverpool St;AIRPORTS:Heathrow;Stansted;Gatwick i.e. a colon after each heading but a semicolon after each entry This does't work as a row source in access but could I get this some other way? Similarly how does one gert an unckliable greyed out option in the middle of a combo dropdown list? Thanks |
| Sponsored Links |
|
#2
|
|||
|
|||
|
Happy,
The ComboBoxes & ListBoxes in Access are pretty rudimentary. They don't allow for presenting a heirarchical list and they don't allow for "graying out" individual items. They don't allow for any differentiation between rows; You could however put your data example into a ListBox using the ";" delimiter. It would display in your specified order. Then you could use the OnClick event, and if the item was selected AND was UpperCase, you could De-Select it. Not really un-clickable, but the click doesn't really do anything. Wayne |
|
#3
|
||||
|
||||
|
Perhaps you could use cascading combo boxes or a tree view control ?
Dave
__________________
Apathy is on the increase, but who cares. Imagine if there were no hypothetical questions
|
|
#4
|
|||
|
|||
|
Thanks for your replies! So is access just not as powerful as other programs? I was sure I could imitate it!
![]() |
|
#5
|
|||
|
|||
|
Happy,
Access is VERY adept at allowing for the rapid development of db applications. Its strong points are the ease with which you can create/modify tables, develop forms/reports and interact with other MicroSoft applications. The short amount of time required to develop a small application can't be touched with something like VB, C++ or even an integrated package like ORACLE Forms. For most apps, the standard combos and list boxes are fine. There are third-party add-ins that support things like the shading of individual rows or bolding/colors within text fields. Dave's point about the Tree View control might be worth looking into. Overall, Access will provide a foundation that is easy to work with. When it doesn't meet a need such as this, either change the specs or enlist some third-party software. Wayne |
|
#6
|
|||
|
|||
|
Quote:
You can simulate this in code as has already been suggested. You can also do it with cascading combos which would be my choice. The first combo would list the types of transportation and the second would list the related set of departure/destination locations.
__________________
Bridge Players Still Know All the Tricks |
|
#7
|
|||
|
|||
|
I am very careful with database rules. actually this list is populated with an external ini file but I respect what you say Pat
Thanks for your remarks! |
|
#8
|
|||
|
|||
|
If the list is populated from an external source, normalize it first so you can use cascading combos.
__________________
Bridge Players Still Know All the Tricks |
|
#9
|
|||
|
|||
|
Its not an external table. Its one line of an ini which gets pasted straight into the combo control as values . Since its separated by semicolons, each part becomes a different row in the combo!
|
|
#10
|
|||
|
|||
|
If the import is a one time event, how much trouble could it be to do it right? Surely your users are not copying and pasting the value list.
If you don't want to normalize the data, you're stuck with writing code in the BeforeUpdate event of the combo to prevent headings from being selected.
__________________
Bridge Players Still Know All the Tricks |
|
#11
|
|||
|
|||
|
As the form opens it reads an ini to know how to populate those combos. Each line is a different combo. The program is generic. All thats different is the ini. What do you mean 'prevent headings from being selected'? and how do I display them?
Thanks |
|
#12
|
|||
|
|||
|
Either modify the source to include a semi-colon after the colon or insert it yourself after you read the ini file and before you populate the list. Your code can look for entries that end with ":" and not let the user select them.
Where do these ini files come from? Who maintains them? There are better ways to control the contents of combos than importing text lists each time a form is opened.
__________________
Bridge Players Still Know All the Tricks |
|
#13
|
|||
|
|||
|
Such as? reading them off tables? Why must everything in access be governed by tables? (polite question)
The ini is maintained by the designer not the user |
|
#14
|
|||
|
|||
|
Quote:
I have a table and several forms/reports that I add to every application I build. The table contains all the code values my combos will use. I only need to create specialized code tables in very special circumstances. Quote:
__________________
Bridge Players Still Know All the Tricks |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|