INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

How to

How to create large Checkboxes, a second method by jedel
Posted: 17 Oct 05

After reading some FAQs on this subject, it got me to thinking of a method that I can use to query and sort records by using the check box as well. Here's how I would do it, not that any other method is wrong, or that my method is better, It's just another angle:

1.  Create a field in your table and call it ChkField (or something you can relate to)

2.  In your form place the field where you wnat to put it and change the font type to "MonoType Sorts". This is important as we use the characters "4" and "8" which represent a Tick and a cross respectively. Also, change the Tab Stop to "No"

3.  Create a command button on your form and make it transparent. call it "CmdFocus".

4.  Now, in the "on Click" event of the field, place the code below:

CODE

Dim lgRed, lgGreen As Long

lgRed = RGB(200, 29, 4)
lgGreen = RGB(70, 150, 56)

If Me.ChkField= "4" Then
Me.ChkField= "8"
Me.ChkField.ForeColor = lgRed
Me.cmdFocus.SetFocus
Else
Me.ChkField= "4"
Me.ChkField.ForeColor = lgGreen
Me.cmdFocus.SetFocus
End If

Each time you click on the field, it changes between a tick and a cross and puts the focus back to the CmdFocus button to stop anyone from typing anything else in the field. You can now sort records out by querying all records with either a 4 or an 8 in this field. There is some colour there for bells and whistles, but you can get rid of that if you like.

I need to do some more testing on this, but it seems to work fine

Back to Microsoft: Access Forms FAQ Index
Back to Microsoft: Access Forms Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close