Add looking glass icon to search text box?

got_access:]

Registered User.
Local time
Today, 03:54
Joined
Jun 15, 2018
Messages
83
Hi all!
I have a data search form which contains a top section having a text field which initiates a parameter query. I type text into the search box and then press enter. Enter activates a macro which initiates the query and returns the results into a sub-form in data-sheet mode below - located below the search box.

For cosmetics - I wanted to have an icon of a magnifying glass inside the text search box. So I extended a blank box to the right of the text box to locate this icon there.
Its ok - but it doesn't look as professional as Access icons normally do.

Does anyone have a suggestion about how to add an icon into a text control box?
Big thanks!
 
I extended a blank box
Don't know what kind of "box" that is.
I'd suggest an image control or a command button to initiate the search instead of Enter key. Either control can take click events. Not sure what you're saying is wrong with the current icon? It's not being rendered correctly? Or it's just not attractive even if you open it from Windows folder? Or is it a built in Access icon? You could use your own...
 
Last edited by a moderator:
Hi Micron - and thanks!
I thought about using a button - but deferred to using the enter event in the text box so I don't have to take my hand off the keyboard to click the mouse for the button.

I have the icon located near a text box control - with the attempt at making it look like its a part of the text box. But I think now the idea may be a little funky and I'm guessing Access doesn't have a way to format a text box with a picture in it.

I'll live with it the way it is - and ignore the fact that it looks less than professional.
 
Hi. Pardon me for jumping in... Just because you have a button with a magnifying glass, it doesn't mean you have to use it or that you have to stop using the Enter key in your Textbox. The button could have empty/no code, if you like.
 
Agreed, and doing a little magic can be fun, like a "combo" with a button image, let alone on the left side, or a "textbox" that won't come to the forefront and cover its image when you enter it. If my first attempt at inserting an image link worked here, you'll see what I mean.
 

Attachments

  • imageIntxtBox.jpg
    imageIntxtBox.jpg
    7.3 KB · Views: 150
Something like this?

attachment.php


That has three parts:
  • Textbox with transparent border & background
  • Button with transparent border & background next to textbox
  • Box with transparent fill and solid border slightly larger than the above items

However, personally I'm not convinced its worth the effort trying to do this.
Normally I just place a button (that looks like a button) next to the textbox :rolleyes:
 

Attachments

  • SearchBoxImage.PNG
    SearchBoxImage.PNG
    1.8 KB · Views: 797
Mine had the same elements as Isladogs, but I think I used a different box effect rather than the default, which you can see the effects of in the corners if you look closely. I set Special Effects to 'flat' rather than etched. There is something about your version that reveals a slight border near the magnifying glass image.

Looks like I have yet to learn how to get the image right into the post. I read the instructions but no joy yet.
 
Something like this?

attachment.php


That has three parts:
  • Textbox with transparent border & background
  • Button with transparent border & background next to textbox
  • Box with transparent fill and solid border slightly larger than the above items

However, personally I'm not convinced its worth the effort trying to do this.
Normally I just place a button (that looks like a button) next to the textbox :rolleyes:


Beautiful!
It worked nicely!

attachment.php


Thanks very much!!
 

Attachments

Users who are viewing this thread

Back
Top Bottom