Change background color of a text field that has focus

Posted on Sunday, April 6, 2008 - 19:42 | by admin |

For those who want to give a different effect on the forms, more specifically when we are entering data, we can change the color of the field where the cursor. That is, all data entry fields are in the white than the field where we are writing that is of another color.

To do this it is very easy, just select the fields and pick the background color you want to appear when the cursor is in the field and then change the color to transparent.

Download: Change color data field

RSS feed | Trackback URI

10 Comments »

Comment by I
2008-12-19 17:27:39

But this only works for forms white background.

The ideal was a command "Upon receiving focus, paint the background ...

Comment by Administrator
2008-12-19 22:03:07

Works with all background colors. If you like the example, can change the background color of the form that works in it.
If you want to change through code can do so:
Private Sub Morada_GotFocus ()
Me.Morada.BackColor = 8454143
End Sub

Private Sub Morada_LostFocus ()
Me.Morada.BackColor = -2147483643
End Sub

That is to receive the focus of the control paints the background of yellow and lose focus gets transparent.

Comment by A. Pike
2008-12-29 15:46:21

First congratulations on the blog. Very Useful!

I used the code posted, however, got the following error:

"Name repeated found: Solicitante_LostFocus"

Could you help me?
Thank you.

(Maximum Level of progress.)
Comment by Vitor
2009-05-04 16:02:48

Probably have two controls with the same name ...

Where to put the code??

Put here the complete code to see your mistake.

Comment by A. Pike
2008-12-29 15:44:41

Dear Jose Martins

First, congratulations on the blog! Very useful for users who, like me, are new to Access.

I used the code posted above, however, I get the following error message: "Name found repeated: Solicitante_LostFocus"

Could you clarify this doubt?
Thank you.

Comment by Nete ALVES
2009-05-03 22:13:18

Good Afternoon Jose

thank you for sending me the e-mail tips on how not to open a form that does not cotenha record, was much benefit to my project, gave just right.

Now, not taking advantage of his kindness to help me like the following:
Hello good day Joseph

1.Tenho a command button with the following settings: background style: transparent, colored transparent fill position send to front

2.Tenho also an image behind this command button with the following: Send setup position back in the same size of the command button and in the same position of the command button

How do I get, when I hover your mouse over this set of button and image enhancement it an accent color on this set, with the possibility of choosing the highlight color.

Thank you for your tips and your blog is very bomnos helps a lot because I'm starting now.
Until the next
Nete ​​Alves

Comment by Administrator
2009-05-03 22:51:44

You can do this in several ways, one of which may include a 2nd image with the changes you want and then show the picture you want 'to move the mouse "over the button using the command:
imagem1.visible = true
imagem2.visible = false
and then put a rectangle larger than the command button to receive focus when you do the opposite:

imagem2.visible = true
imagem1.visible = false

To see running download the example button

Comment by Sebastian
2009-07-14 00:14:00

Hello!
Good Evening I am in a dilemma and would like your help if possible
I did a system access to my brother who owns a shop
form to register with stock and other
my problem is just the product registration form
I record everything right but my brother said that occasionally he changes the cost of the product
and he wants to control the price of the previous cost
because when it changes the cost of the product all the previous sales are based on new cost please help me if you want I can send a copy of the system
to give you

Comment by Administrator
2009-07-24 14:51:42

As I realize the tables are poorly constructed, since by changing the value of a product should not alter previous sales. Or sale of the table must have a field to set the value of the product so that when changing the value in the table does not change the price and the record for each product value regardless of whether the value is changed or not. If you want to send a copy of the database that I check.

Comment by Charles Jackson
2010-03-25 20:53:46

First congratulations on the initiative of setting up something so important for anyone who works with the access.

My friend, I need a help,
I need a code that hides some items of a record when I select a button when I print.

Example: Registration Form

Name:
Address:
Neighborhood:
City:
UF:
zip:
Phone:

Button (O) Anonymous

When the button is clicked anonymous
in place when printing only prints the name "anonymous" and the address and phone number is in white or all white except the CEP.

Please help me

Thank you

Jackson

Name (required)
Email (required - not published)
Website
Your comment ( Decrease | Increase )
You can use <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <b> <cite> <code> <del datetime=""> <em> <i> <Q cite=""> <strike> <strong> in the comments.

Presentation

Avatar

Thank you for visiting.
Subscribe to feed not to miss any messages.

Here in blog I will provide examples of working with Microsoft Access and also ask questions to those who ask. More

Want to subscribe?

Subscribe or subscribe by email:
Enter your email:


Ads