Making textboxes look like buttons



If you want your textbox behaves like a command button, can't you just use a
commandbutton instead (set the value to commandbutton.caption). that case
it'll work just like a command button specially it seems like you don't want
your users to click that textbox.


You can set your textbox's SpecialEffects property to Raised to make it look
more like a button.
If you set its Locked property to True, but leave Enabled as True, your
users will be able to click or double-click it, but not change the value it

As you can see from all these responses, there are lots of approaches to
Hope one of them suits your needs!


I have controls that show data from underlying queries, and I want the
double-click of several of them to open a new form based on a different
query (which uses the value in the control clicked as a filter). This is
easy, but I'd like for the controls (textboxes) to look like buttons rather
than have the values in them highlighted when they are
clicked/doubleclicked. It scares the user into thinking they're about to
delete data, and it also looks a little ugly. I can't, however, fire a
double-click (or any other) event on disabled controls. Is there some other
way to do this?

Thanks for any advice.
Apr 9, 2019
Reaction score
In a multiple item form, rather than try and make a text box look like a button, you can add a button to the item lines. Then use the on click event to refer to the text box you wanted to act as a button. For example if the text box is called Airline, the following code shows how to access it.
Private Sub MyButton_Click()
    MsgBox (Screen.ActiveControl.Parent.Airline.Properties("Text"))
End Sub
Note, MS Access requires you to set focus to the text box before you can use its properties or methods.

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