Button to insert Symbol

J

Jacky

Hi, I'm currently preparing a form on which some unique symbols are to be
used on the inputting. Since this symbols are not conveniently available on
the english keyboard inputs, I'm thinking to create buttons for these
symbols, where when clicked, the symbols will be paste on to the current
cursor location and the user be able to continue the inputing, in the same
field after the newly inserted symbol.
 
L

Linq Adams via AccessMonster.com

You don't say where you getting these symbols from, so I'll just show you the
code you need using an ampersand. You can use Windows Character Map to find
them or insert them from another source.

Private Sub InsertAmpersand_Click()
Screen.PreviousControl = Screen.PreviousControl & "@"
Screen.PreviousControl.SetFocus
End Sub

You can return focus to the textbox involved with

Screen.PreviousControl

but you can use it with SelStart to send the cursor to the end of the data
after the insertion, so you need to do this for each possible textbox that
you'll be using this with:

Private Sub TextBox1_Enter()
TextBox1.SelStart = Nz(Len(Me.TextBox1), 0)
End Sub

Private Sub TextBox2_Enter()
TextBox2.SelStart = Nz(Len(Me.TextBox2), 0)
End Sub

and so forth. Enter data in whatever field you need to, then when necessary,
click on the insert button, and the special character, in this case an
ampersand, will be inserted in that field and the cursor will return to the
end of the data in the field, ready for the next character.
 
J

Jacky

Hi Linq,

New add-on to the problem:

Method highlighted previously worke for normal symbol like ampersand or ohms.
However this would not work for those symbols arrows (horizontal and down
arrows) from fonts Windings 3.

How can I make use of these symbols? The coding part I'm unable to copy and
paste in the symbol correctly.

Thanks for the helping.
 

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