labels in your text box

cardgunner

Registered User.
Local time
Today, 12:04
Joined
Aug 8, 2005
Messages
210
In a form's text box can you have it labeled in the box, rather then on the side or above it? I have seen this in other applications on the web and such where the text box has it's label in the box. It looks like a watermark. You click or tab to it and it goes away. If you enter something in the text box it stays away.

This will save me space on the form. I won't have to have labels for all my text boxes. The text box will have it's own label in the text box space.

I got it to work sortof by placing the label over the textbox. However after to leave the field the label shows up over your record. Can I set a condition on that label to if the field is null the show if not null then do not show?
 
Maybe you're talking about the ControlTipText property. It can be done programatically but type in something into that property first, hover your mouse over it and see the effect.
 
That is almost it. However I want it there untill you click in the field. When you click in the field it goes away. Usally the fony is Italic and Light grey in color. Like a waterwork of sorts.
 
I don't know if this is kosher, but it could work.

Have an unbound text box. On the form open, if you want it only for a new record then you could do something like:

Code:
If Me.newrecord then
     Me.txtbox = "WhateverTextYouWant"
    'You can even set the forecolor
     Me.txtbox.forecolore = whatevernumberyouwant
Else
'add code here to bind the control to the field it's supposed to have and reuery the form
End If


Of course, this is just an idea, I don't know if it will work.
 
Can you do a conditional format of a label?

No, but you can have a text box formatted to LOOK like a label and that can be conditionally formatted.
 
No, but you can have a text box formatted to LOOK like a label and that can be conditionally formatted.

I was trying that. Set the default value to "Label". Placed it over the text box. But I couldn't get the formatiing correct. I am using the conditional format tool and not working out.

I also set the control source of the textbox/label to the textbox it is going over.
 
I was trying that. Set the default value to "Label". Placed it over the text box. But I couldn't get the formatiing correct. I am using the conditional format tool and not working out.

I also set the control source of the textbox/label to the textbox it is going over.

So you are chucking the other ideas? Have you looked at Dr B's example? It's pretty awesome.
 
Kryst, You are right Mr. B example is pretty awesome. That is the exact look I was wanting. Exactly.

But (there's always a but) when I clicked on the record indicator it created new records and in those new records it had the text of the label. However if I "overwrote" the label it didn't. I'm still playing around and looking at the code to undersatnd it and how to get that code into my form.

Mr. B nice work!
 
Kryst, You are right Mr. B example is pretty awesome. That is the exact look I was wanting. Exactly.

But (there's always a but) when I clicked on the record indicator it created new records and in those new records it had the text of the label. However if I "overwrote" the label it didn't. I'm still playing around and looking at the code to undersatnd it and how to get that code into my form.

Mr. B nice work!

That is definitely how it works. and shouldn't be a problem as the only person who should be looking at your tables is you. No one will ever know that it is directly entered into the table.
 
That is definitely how it works. and shouldn't be a problem as the only person who should be looking at your tables is you. No one will ever know that it is directly entered into the table.

It doesn't matter that nobody will see what is in the table. The prompts should NOT be saved. They should be discarded in the form's Before Update event prior to saving. Saving the prompts is very BAD data integrity and would cause issues when trying to query the data.
 
It doesn't matter that nobody will see what is in the table. The prompts should NOT be saved. They should be discarded in the form's Before Update event prior to saving. Saving the prompts is very BAD data integrity and would cause issues when trying to query the data.

Good to know, I am not sure how to modify Dr. Bs example so that it doesn't do this.
 
I think we would need to get rid of the navigation bar at the bottom and then have a custom button to add a new record so we can run a check first and change it to blanks for fields not filled out and then run a save. I was playing with the Before Update event for this but it didn't want to work right.
 

Users who are viewing this thread

Back
Top Bottom