Yes/No fields on a form

S

Shele

I am building a recruiting database for a department at work. In one area on
my form, I have a series of Yes/No toggles and check boxes for certain skill
sets. This works well and queries the way I want, but what I really want is
for certain options to be "highlighted" if they are true. For example if an
applicant is bilingual, I want that to pop out at me as I review applicants.
I really don't see any easy way to format a toggle button, unless I do
something on the OnDown event. Unfortunately, I am lost when it comes to
events and VB, nor am I sure that it can even be done in Access 2003.
Anyone have any ideas?
 
K

Ken Sheridan

Provided the form is in single form view you can change the colour of a
toggle button's caption with code, which should go in its AfterUpdate event
procedure *and* in the form's Current event procedure, e.g. to change it to
red when depressed, black otherwise:

Dim ctrl As Control

Set ctrl = Me.YourToggleButton

If ctrl Then
ctrl.ForeColor = vbRed
Else
ctrl.ForeColor = vbBlack
End If

You can't format a check box, although you can use dummy check boxes, which
are in fact text boxes set up to look and work like a check box. This needs
code too as what's actually clicked is a transparent button over the dummy
check box. This assigns a True or False value to Boolean (Yes/No) column in
the underlying table, and this value controls the appearance of the dummy
check box via an expression as its ControlSource property. I did produce a
demo of this some time ago for a magazine column by a contact of mine. I
don't think its available on-line now, but I can mail it to you if you care
to contact me at:

kenwsheridan<at>yahoo<dot>co<dot>uk

However, the design you've adopted is a poor one. The skills per applicant
should be represented by multiple rows in an ApplicantSkills table which
models the many-to-many relationship type between an Applicants table and a
Skills table. What you've done is in effect use Access like a spreadsheet,
not a relational database management system.

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top