Nifty Option Group

Nifty Option Group - Wingding

The Option Groups in Microsoft Access are at best a fine utility, however they do not lend themselves to much modification. You are stuck with an antiquated looking Option Group.

If you want something a bit special, then have a look at my product “Nifty Option Group” Whilst creating a class module for locking and unlocking controls, I realised that I might be able to apply the techniques I had developed in this exercise to the problem of the Antiquated MS Access Option Group.

I realised that I could have a set of text boxes, instead of Option Buttons, Textboxes, which would contain either a Cross or a Tick using the interesting images derived from the Wingdings set of characters, the Capital “P” and Capital “O” … But how?

UPDATE!!! The Option Group on this page uses Wingding characters for the Smiley Faces. I worked out how to do it with images.

You will find the image version here:- Nifty Option Group with 7 Stars (And Images) I’ve changed the type of this page from “Nifty Option Group” to “Nifty Option Group – Wingding” so that I can differentiate between the two methods of creating custom Nifty Option Groups.

I will maintain both Systems The Wingding System and the image system, because they both have their advantages and disadvantages. If you want to know what those are, let me know and I will blog about it.

Nifty Option Group - Wingding

Nifty Option Group

Video 1 01:10)

In this video I do a quick run through of the Nifty Option Group.

Video 1 01:10)

Nifty Access YouTube Thumb Nail
Play Video

… …

Nifty Option Group - Setup

Nifty Option Group - Setup

Video 2 (13:08)

The Nifty Option Group consists of a Frame, which Microsoft Access calls a “Rectangle”. Within that frame you have the Simulated Options, which are actually text boxes with their corresponding labels.

Open the property sheet of the rectangle and you will see that the Tag property contains an interesting set of information. The contents of the tag property look something similar to this:- SmileyFace|Wingdings|J|L|Text46|ZeroYes — there are 6 pieces of information separated by 5 “pipes” (|)

Video 2 (13:08)

Nifty Access YouTube Thumb Nail
Play Video

Code Links:-

The Rectangle – Tag Content
  • The first piece of information “SmileyFace” indicates the field where the option group selection is stored.
  • The second piece of information “Wingdings” is the set of characters you want to use to display the true/false, yes/no values.
  • The next piece of information is “J” this provides the yes value, in this case a “Smiley Face”.
  • The next “L” provides the no value, in this case a “Sad Face”.
  • The next piece of information “Text46” provides the name of the control you want to set the Focus to, after the Option has been selected. If you don’t want to move the focus away from the simulated Option Group, then replace “Text46” with “None” and the focus will remain within the Option Group.
  • The final piece of information “ZeroYes” allows the programmer to specify whether double-clicking the Nifty Option Group will save a Zero (0) to the underlying table. Zero (0) denotes that there is no suitable answer, it means it’s not a valid answer, a valid answer has not been provided or is not available. If you place “ZeroNo” in this setting the Nifty Option Group will work like a normal option group. A normal option group doesn’t have the facility to enter a Zero (0) (denoting “NO SELECTION MADE”) in the underlying table.
The Text Boxes

Open the property sheet of one of the text boxes contained within the Rectangle. The Tag property contains a number. This “Number” will be transferred to the Forms underlying table. It is transferred into the field as specified in the Tag property of the Rectangle. In this example it is “SmileyFace”.

Nifty Option Group - Interesting!

Nifty Option Group - Interesting!

Video 3 (02:44)

In this Video I show some points of Interest

Invisible controls

I don’t like having invisible controls plastered all over my forms, it just a bit untidy if you ask me! I decided to have a look to see if I could do something with the invisible Microsoft option group. I discovered I could delete all the controls with it, (the option buttons) “the buttons you select”, and it still worked, not as a stand-alone option group you understand, but it still worked in conjunction with the Nifty Option Group. I was a little surprised at first, but thinking about it, it made sense.

Use Option Group Frame

I realised that the option group itself is a frame, and I’m using a rectangle which occasionally Microsoft refers to as a “Frame” so I could see the similarity. I reckon there’s a possibility that I can do away with the “Frame” (RECTANGLE) I’m using, and just use the Option Group Frame as a container for my text boxes.

I might have a go at this. Let me know what you think. The more “likes” I get for this Video, the more likely I am to do this. Give me a bit of incentive!

Video 3 (02:44)

Nifty Access YouTube Thumb Nail
Play Video

Change Test Boxes to Image Control

The other thing I’ve been thinking about is changing the text boxes that contains the wingding characters. I want to change to an image control and have actual images for the yes/no true/false results. I’ve no idea how to go about this and I’d be very grateful if anyone else has experienced in this area and could point me in the right direction.

UPDATE!! I’ve Done it! Nifty Option Group – With 7 Stars I worked out how to change the Wingdings into images. And fortuitously, I happened upon another Function! I could change the Option Group to no longer work as an Option Group, but work as a “Star Rating System” it was a minor change to the code! So I’m adding it to the new option group (with Images) as a BONUS… Follow the link for more Info..

… …

Error 94 Invalid Use of Null

Error 94 Invalid Use of Null

Video 4 (02:19)

Nifty Option Group Error 94 – Invalid use of Null – This error occurred when I added a new field to the table to store the results from the Option Group Selections.

This new field holds a new Option Group Selection called Letters. When a new field is added to a table it does not automatically take the default value for the field, you have to add this yourself. The VBA code for the the Nifty Option Group was not expecting a “NULL” value in the field hence the error. The solution was to add the default values with an update query, as shown in this video:-

Video 4 (02:19)

Nifty Access YouTube Thumb Nail
Play Video

… …

More Useful Stuff HERE:-

This website uses third-party software - WordPress Add-Ins to be exact. I don't know what any individual add-in does, but I'm sure that many of them collect information about you. So be aware, if you continue using this site, then you are likely to be sharing your information. I don't know how to disable this sharing for any, or all of the plugins for individual users. So I can't stop the sharing of information. If this worries you then please do not use this site... If you continue to use this site I will assume that you are happy with it.

Do you need a hand in the right direction?

You are in the right place.