VB Programming

Radio Buttons & Check Boxes

Radio Buttons
These controls are similar in that they let the user select from a set of options. They are different in that Radio Buttons only allow one of the set to be selected at a time, while Check boxes, if used in a set, can have several in the set turned on at the same time. Selecting one Radio Button means all other buttons in the set are deselected. So Radio Buttons are used to select among mutually exclusive alternatives and are always used in sets. They appear as a circle and when selected have a dot in the circle.

On the other hand, check boxes may be used singly or in a set, and when in a set several can be selected at the same time. Check boxes are a square and when selected show a check in box. You should think of these as a push button control for turning specific features on or off. The clickable area of the buttons is larger than at first appears since you can also click on the text accompanying the buttons in order to activate the button.

The event generated when the user interacts with these controls is not a click event as it is when the user interacts with a button, but a CheckChanged event. This is because when the user clicks on these controls, they intend to change the current status of the control. A problem occurs when a beginning programmer, or one new to VB, assumes that a click means the user is selecting (turning on) that option. It is actually just as likely that the user is deselecting or turning off that option.

Think about the operation of a Check Box compared to a Radio Buttons. Check boxes have to be deselected by the program user whereas Radio Buttons are automatically deselected for the user when they click on a different radio button.

So, does clicking turn the check on or does it turn the check off? Truthfully it can do either one. If the check is currently on then clicking it will turn the check off and vica versa. This is precisely the reason why the procedure is named CheckChanged. It is changing the check from its current state to the opposite state. Radio buttons and Check boxes are controls which alter the state of something in a program. Buttons are controls which activate an event procedure. If a programmer forgets that the Radio button and Check box event is CheckChanged, their coding will generate peculiar and unreliable results. Here is a program you can download which demonstrates this behaviour.

The most important effect of this, is that when we code using these controls, we must not assume that the user event is turning the state of the control on, rather it is changing the state of the control. It might be turning the control off. The easiest way to cope with this ambiguity when coding is to always use a Forced Choice selection structure. Explicitly check the state of the control by testing the Checked property of the control. Then provide one set of commands to be executed if the control is being selected, and another set of cammands to be executed if the control is being deselected. This way we can code the event to respond appropriately whether it is turned on or whether it is turned off. Typical code would look like this:

If EmailOptIn.Checked then
    optIn = True
    optIn = False
End If

This is better code - more reliable - than using just a conditional and incorrectly assuming that the user is always turning the control on. Making assumptions about the state of controls in programming always causes problems sooner or later.

Organizational Behaviour

The Short and Glorious History of Organizational Behaviour

The study of how people behave in organizations is useful to all organizational participants. It helps the top level participants understand how to manage the organization. It helps managers become better at controlling their departments. It helps lower level participants understand why things are the way they are and how to protect themselves against being victimized by a system that appears to largly take them for granted. It offers help in understanding orgaizations from operational, tactical and strategic viewpoints.

One interesting introduction to this field, and a favourite of mine, is an overview written by Charles Perrow entitled "The Short and Glorious History of Organizational Theory". The article was originally published in Organizational Dynamics (Summer 1973). I read it in a compilation called Classics of Organization Theory while in a masters program in the early 1980's. The author employs a tongue in cheek style and renders the history as a struggle between the forces of light and the forces of darkness. What follows is my synopsis of Perrow's article.

Perrow characterizes organizational history in terms of two main forces. Those forces of research which treated an organization as a mechanical thing, he characterizes as the forces of darkness. The forces of light collectively refer to research that has a more humanistic basis and theme. "From the beginning, the forces of light and the forces of darkness have polarized the field of organizational analysis and the struggle has been protracted and inconclusive." The forces of darkness refer to such things as Taylorism (father of time and motion studies), division of labour, specialization, and line of authority. The forces of light comprize the human relations movement, Hawthorne studies and related themes. These aspects of organizational investigation emphasize people, accomodations and biological analogies over mechanical ones.

Scientific Management

The show gets started with the rise of Scientific and Classical Management. Emphasis was on planning, record keeping, reduction of span of control to about six, decisiveness and other rather simplistic pronouncements. The primary examples of organizations were the military and the Catholic church and organizations were seen as mechanical entities. As organizations expanded, most of these admonitions worked. However, the one constant in human affairs is change, and several factors arose which were problems for the formulae of the time. These included:
  1. Increasing importance of Labour accompanied by its rise in power.
  2. Increasing diversity of markets, proliferation of products, and increased complexity of technology.
  3. Changes in cultural, political and social changes altered the expectations of the general population with respect to the workplace.
  4. As growth increased organizations became too large and diverse to be seen as an extension of their owner. Mergers proliferated and a general preoccupation with management and leadership emerged.

Enter Human Relations

Although some individuals had opposed Scientific management they were mostly ignored. However, these voices received a tremendous boost from the publishing of two studies. The first was a book by Chester Barnard who proposed the theory that an organization is a "cooperative system" rather than a mechanical system. Then came the Hawthorne studies which emphasized the importance of human factors such as informal work groups, norms, and social relationships and their effects on productivity.

Attention then turned to the study of leadership. At first the emphasis was on leadership traits and the list sounded, as Perrow stated, "like an enumeration of Boy Scout qualities: kind, curteous, loyal, courageous". The research did turn up differences between employee centered aspects of leadership (consideration) and job centered aspects of leadership (initiating structure) and this provevd to be a fruitful area of investigation. It also bolstered the human relations approach to the study of organizations.

The Tavistock investigations into what is now known as sociotechnical systems also found important relationshsips between productivity and work groups. The practical negative impact of actions such as routine tasks, submission to authority, specialization of task, ignorance of the goals of a firm and centralized decision making on a group's morale were well documented. Another interesting discovery was how social systems interacted with job task considerations. Far from having only a negative influence on work productivity, social interaction was found, under certain circumstances, to improve work productivity.

The pace of change of technologies and the turbulence of the environment brought new views of how organizations ought to be organized. Models of the organization began to move toward organic and social systems rather than mechanical. While the models became much more complex, most agreed the models were much more realistic and very much more revealing.


Desktop Publishing


In 1985 the introduction of an inexpensive laser printer (it sold for less than $5,000) and a software program from Aldus corporation called Pagemaker (cost about $1,000) triggered the creation of what today we call Desktop Publishing. Prior to the introduction of those two items, it was common to spend over $100,000 for computer hardware, software, image setters, and to hire a 'typesetter' or two and set up in business. By 1986 there were no more typesetters. Most of them had gone into business for themselves by buying a Macintosh computer, (Pagemaker only ran on Macintosh computers at the time) a laser printer and Pagemaker. Desktop Publishing allowed us to easily combine text and graphics on the same page, and anyone could do it!

The only advantage that typesetters had over a novice who bought the same equipment, was they knew what they were doing and how to do it quickly. The rest of us were on our own and what was produced by all those novices was thrilling, and at the same time rather chaotic. It took a few years for the novices to learn the rules that the typesetters knew well. Ironically the typesetters were in the best position to educate the rest of us, but by and large, they did not take up the gauntlet. The traditional way to learn the trade was to apprentice with an established typesetter and learn over time.

This is not an uncommon situation. When paradigms change it is the established people who have the first opportunity to take advantage of the changes. Often they are the last to see the inevitability of what is happening. So most of them resist such change, and it usually takes an outsider to see the real potential and act upon it. However this generalization is a story for another time.

One of the first people to provide instructions on how to get professional looking results with less time and effort was Robin Williams - the author and teacher not the commedian.

At this time a Maintosh computer could be purchased for about $2,000 to $3,000; the Laserwriter debuted at under $5,000, a real steal compared to other high quality printers at the time which could run as high as $100,000; and Pagemaker from Aldus Corporation weighed in at just under $1,000. For under $10,000 you were set up in the typesetting/publishing business. Just a year before a package of hardware and software to do the same thing had cost over $100,000. What an opportunity!

Of course, you could only actually do the first six steps of a traditional twenty-four step publishing process, but it was the most revolutionary advance since the introduction of the printing press by Johannes Gutenberg and others in the 1400's.