Form Text Box (1 Viewer)

PatAccess

Registered User.
Local time
Today, 05:52
Joined
May 24, 2017
Messages
284
Good day all,

I've created a login form for my access database and I was wondering, How can I place the instruction in to a Text Box accompanied by an icon

For example: In my userID text box, I would like it show "UserID" or "Enter your UserID" where it's grayed out on the white background.
Any ideas? :confused:

Thank you,
 

isladogs

MVP / VIP
Local time
Today, 10:52
Joined
Jan 14, 2017
Messages
18,213
Set that as the default value for the textbox
 

PatAccess

Registered User.
Local time
Today, 05:52
Joined
May 24, 2017
Messages
284
I entered "Please enter User ID" in the Default Value property under the data tab with I still don't see it when I go to form view?
 

PatAccess

Registered User.
Local time
Today, 05:52
Joined
May 24, 2017
Messages
284
I found a way to do it in VBA but is there a way to remove the paint color behind the text?
When I go back to Form view, the word is showing white behind its own background. I guess this is where I have an issue.

By the way, this is an unbound text field

Thank you,
 

isladogs

MVP / VIP
Local time
Today, 10:52
Joined
Jan 14, 2017
Messages
18,213
You can use the property sheet or VBA. Its the same outcome
Doesn't matter whether its bound or unbound.

Why are you using white text?
Just use different colours for the default text and background
Set the forecolor to e.g. grey and the backcolor to white (or vice versa)
Or set the back style to transparent with dark text forecolor
 

MarkK

bit cruncher
Local time
Today, 02:52
Joined
Mar 17, 2004
Messages
8,180
Here's a little trick I do to 'embed' a label in a textbox, and have that label go away automatically after the user enters actual data in the field. This way you don't need actual label controls, which can tidy up the design of your forms.
See what you think,
Mark
 

Attachments

  • dbTest.zip
    40.4 KB · Views: 209

isladogs

MVP / VIP
Local time
Today, 10:52
Joined
Jan 14, 2017
Messages
18,213
Mark
That's neat.
I've always highlighted the control with focus using VBA. I'd never thought of using CF to do so.
 

MarkK

bit cruncher
Local time
Today, 02:52
Joined
Mar 17, 2004
Messages
8,180
Mark
That's neat.
I've always highlighted the control with focus using VBA. I'd never thought of using CF to do so.
Lol, that's not what I was trying to demonstrate with that, but glad you liked it. :)
I think the cool part is how the CF test-for-null works with the Format property--which specifies replacement text for null values--and the fore color, to show a gray-ghosted prompt in a null textbox, but a full-black ForeColor in textboxes that contain data.
Mark
 

isladogs

MVP / VIP
Local time
Today, 10:52
Joined
Jan 14, 2017
Messages
18,213
MarkK
I'm sure i would have been equally impressed with the conditional text formatting for null/not null ... but I already use that idea!

Tony
I tried to think of some plausible alternative spoof answer for CF but I can't think of one now so it will have to carry forward to my next reply
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 10:52
Joined
Jul 9, 2003
Messages
16,280
Tony
I tried to think of some plausible alternative spoof answer for CF but I can't think of one now so it will have to carry forward to my next reply
I think the acronym FC instead of CF is more appropriate for this thread.
 

Mike Krailo

Well-known member
Local time
Today, 05:52
Joined
Mar 28, 2020
Messages
1,044
I see this is an old thread but wondered why no one mentioned that the date/time field in the example database is formatted as a number to the user? What's up with that? How can the entered date time be displayed as a date/time if the format property is already being used for swapping out the label for the data?
 

Users who are viewing this thread

Top Bottom