Changing color of controls when a checkbox is clicked

R

RebootKidFL

Hi again

I would like to know how can I do, so that when a user cliks something like
a check box changes the color of a Label Control.

Also, I'm stuck with something very weird and unique: the owner of a
database I'm creating for that person wants... a procedure so that when a
record is already in the database may the database warns that there's a
similar or possible record "dupplication" in the database.

Please I'm desparate...

RebootKidFL
 
W

William Hindman

....conditional formatting is highly dependent upon the version of Access you
are using ...given that, a net search on the subject will give you hundreds
of examples for the version you are using.

....duplicates checking is neither weird nor unique ...its a given for any
business quality code ...A.D. has an excellent sample mdb at
http://www.rogersaccesslibrary.com/Otherdownload.asp?SampleName='Forms_CheckReqdAndDuplicates.mdb'
that will give you everything you need to more than meet the owner's
desires.

....hth

William Hindman
 
R

RebootKidFL

Thanks but the page doesn't comes out on my IE 7... Showing the following
error : ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.

/Otherdownload.asp, line 32

Thanks for your help
 
W

William Hindman

....lol ...how I learned not to install beta software on a development
workstation! :)

William Hindman
 
C

CompGeek78

On the part about avoiding duplication in your records, proper use of
primary key and index fields should avoid this. The database on the
website the other poster mentioned uses the primary keys to ensure
uniqueness, the thing that database has that your database wouldn't is
code in the form to help present more user friendly error messages
instead of the default Access error messages.

As far as the color changing labels goes, your only choice is to use
code to alter the properties of the label. Try something along the
lines of:

If IsNull(Check) Then
Label.ForeColor = RGB(0, 0, 0)
ElseIf Check6 Then
Label.ForeColor = RGB(255, 0, 0)
Else
Label.ForeColor = RGB(0, 0, 0)
End If

That will need to be referenced by a couple events, the click event of
the check box and the current event of the form.

Keven
 
R

RebootKidFL

Thanks ComGeek78

CompGeek78 said:
On the part about avoiding duplication in your records, proper use of
primary key and index fields should avoid this. The database on the
website the other poster mentioned uses the primary keys to ensure
uniqueness, the thing that database has that your database wouldn't is
code in the form to help present more user friendly error messages
instead of the default Access error messages.

As far as the color changing labels goes, your only choice is to use
code to alter the properties of the label. Try something along the
lines of:

If IsNull(Check) Then
Label.ForeColor = RGB(0, 0, 0)
ElseIf Check6 Then
Label.ForeColor = RGB(255, 0, 0)
Else
Label.ForeColor = RGB(0, 0, 0)
End If

That will need to be referenced by a couple events, the click event of
the check box and the current event of the form.

Keven
 

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