Making textboxes look like buttons


G

Guest

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.
 
Ad

Advertisements

R

Rob Oldfield

Overlay a command button with the transparent property set to True.
 
M

MacDermott

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
contains.

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

rgrantz

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.
 
Ad

Advertisements

Joined
Apr 9, 2019
Messages
1
Reaction score
0
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.
Code:
Private Sub MyButton_Click()
    Screen.ActiveControl.Parent.Airline.SetFocus
    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

Top