473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Accented Characters

Hi

I am designing an application to be used by a book dealer and they
have asked if I could develop a function on the form where they could
use accented characters and other european characters. There are
roughly 10 characters they want to use.

I suggested that they use the alt+number combination but as they are
not very computer literate they asked if there was another way of
doing this. I thought that maybe I could put a small command button
for each character on the form and when they click the button it could
paste the special character into the current text box on the form.

I am having difficulty implementing this as I do not know how to
reference the current curson position in the text box with focus. Also
the text box will lose focus as soon as I click the command button.
Can anyone think of a way of achieving this? If you could provide some
code examples I would be much appreciative.

Many thanks

E Thoemmes
Nov 13 '05 #1
4 3547
Hi

I have made a little progress on this problem. I am using the SelStart
property of me.text0 to get the cursor position and then SelText to
paste my special character in. I have posted my code below.
Unfortunately there are still a couple of problems.

As I didn't know which event would work best for capturing SelStart I
have shown all my workings below. The problem with the method below is
if I am typing it text0 and then hit the command button it pastes the
special character at the beginning of the text box but if I manually
move focus to another text box and then place my curson back into the
form press the command button it pastes the character into the correct
position.

Does anyone know why this might happen and also which event would be
best to capture the SelStart - AfterUpdate, LostFocus or MouseUp?

TIA

Option Compare Database
Option Explicit
Dim intPosition As Integer

Private Sub Command2_Click()
Me.Text0.SetFocus
Me.Text3.Value = intPosition
Me.Text0.SelStart = intPosition
Me.Text0.SelText = "à"
End Sub

Private Sub Text0_AfterUpdate()
Me.Text3.Value = intPosition
End Sub

Private Sub Text0_LostFocus()
intPosition = Me.Text0.SelStart
End Sub

Private Sub Text0_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
intPosition = Me.Text0.SelStart
End Sub

Nov 13 '05 #2
pks
Have you considered an autokeys macro that calls the appropriate
function using hotkey combinations? I don't believe that changes the
focus and that might help your positioning.

Nov 13 '05 #3
From Windows Help file:

Using Character Map
You can use Character Map to copy and paste special characters into your
documents, such as the trademark symbol, special mathematical characters, or
a character from the character set of another language.

Open Character Map.

Notes

a.. To open Character Map, click Start, point to Programs, point to
Accessories, point to System Tools, and then click Character Map.
b.. For information about using Character Map, click Help in Character
Map.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com


<ed************@boiukfs.co.uk> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi

I have made a little progress on this problem. I am using the SelStart
property of me.text0 to get the cursor position and then SelText to
paste my special character in. I have posted my code below.
Unfortunately there are still a couple of problems.

As I didn't know which event would work best for capturing SelStart I
have shown all my workings below. The problem with the method below is
if I am typing it text0 and then hit the command button it pastes the
special character at the beginning of the text box but if I manually
move focus to another text box and then place my curson back into the
form press the command button it pastes the character into the correct
position.

Does anyone know why this might happen and also which event would be
best to capture the SelStart - AfterUpdate, LostFocus or MouseUp?

TIA

Option Compare Database
Option Explicit
Dim intPosition As Integer

Private Sub Command2_Click()
Me.Text0.SetFocus
Me.Text3.Value = intPosition
Me.Text0.SelStart = intPosition
Me.Text0.SelText = "à"
End Sub

Private Sub Text0_AfterUpdate()
Me.Text3.Value = intPosition
End Sub

Private Sub Text0_LostFocus()
intPosition = Me.Text0.SelStart
End Sub

Private Sub Text0_MouseUp(Button As Integer, Shift As Integer, X As
Single, Y As Single)
intPosition = Me.Text0.SelStart
End Sub



Nov 13 '05 #4
Here's one way.

1) Create a form
2) Place a textbox on the form
3) Paste the following code into the form
' ****** Code Start ***********
Option Compare Database
Option Explicit

Private Sub Form_Load()
Me.KeyPreview = True
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Dim cTL As Control
Dim tBox As TextBox
Dim intSelStart As Integer
Dim intSelLen As Integer
Dim strLText As String
Dim strRText As String
Dim strInsert As String

strInsert = ""

If (Shift And acAltMask) = acAltMask Then
Select Case KeyCode
Case vbKeyA
strInsert = Chr(224)
Case vbKeyU
strInsert = Chr(218)
End Select
End If

If Len(strInsert) > 0 Then
Set cTL = Me.ActiveControl
If TypeOf cTL Is TextBox Then
Set tBox = cTL

With tBox
intSelStart = .SelStart
intSelLen = .SelLength
strLText = Left(.Text, intSelStart)
strRText = Mid(.Text, intSelStart + intSelLen + 1)
.Text = strLText & strInsert & strRText
.SelStart = intSelStart + 1
End With
End If
End If
End Sub
' ****** Code End ***********
4) Run the form, type some text in the text box and then press Alt-A or
Alt-U on the keyboard.
--
Terry Kreft
MVP Microsoft Access
"E Thoemmes" <ed************@boiukfs.co.uk> wrote in message
news:1c**************************@posting.google.c om...
Hi

I am designing an application to be used by a book dealer and they
have asked if I could develop a function on the form where they could
use accented characters and other european characters. There are
roughly 10 characters they want to use.

I suggested that they use the alt+number combination but as they are
not very computer literate they asked if there was another way of
doing this. I thought that maybe I could put a small command button
for each character on the form and when they click the button it could
paste the special character into the current text box on the form.

I am having difficulty implementing this as I do not know how to
reference the current curson position in the text box with focus. Also
the text box will lose focus as soon as I click the command button.
Can anyone think of a way of achieving this? If you could provide some
code examples I would be much appreciative.

Many thanks

E Thoemmes

Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Fuzzyman | last post by:
I've written an anagram finder that produces anagrams from a dictionary of words. The user can load their own dictionary. ( http://www.voidspace.org.uk/atlantibots/nanagram.html ) In order to...
2
by: Remco van den Berg | last post by:
I'm running a MySQL database with one of tables holding the members of a volleybal club in the Netherlands. One the the fields in that table is holding the name of the players. How do I search...
10
by: John Byrne | last post by:
I have encountered a problem when certain European characters are included in the Querystring of an URL. If I have a URL like: ?param=AAà On the receiving page a simple Request() call returns...
2
by: nicolas_riesch | last post by:
I try to use python as the language in an asp page with Microsoft IIS 5.0. I have these two files, req_bad.asp and req_ok.asp ---------- req_bad.asp --------- <%@LANGUAGE=Python%> <%
4
by: Satish | last post by:
Hi Gurus, Please help me in this, I have tried all options available to me. (Option 1) I am making a simple request from VB.NET client to WBI generated WSDL and passing request parameters. The...
0
by: shintu | last post by:
Hallo, I am trying to write french accented characters é è ê in Excel worksheet using my perl script , But I am stuck here as I couldnt find a way of writing it !: My code: use strict;...
2
by: gsuns82 | last post by:
Hi all, I have to replace accented characters from a input string with normal plain text.I have coded as follows. String input = "ÄÀÁÂÃ"; input=...
4
by: gsuns82 | last post by:
Hi all, I am facing a strange issue. i.e: I have a jsp page with an input text field where the user can enter searching value even along with Accented Characters.After that i...
1
by: gsauns | last post by:
I have an ASP.NET app in which I import from a comma-delimited text file, put all that data in a GridView, and then insert the records into multiple related tables in my SQL Server database. I...
3
by: Jake | last post by:
I am writing a script that allows people to upload a CSV file for processing and I am having trouble with accented characters. If a UTF-8 encoded file is uploaded, everything works fine. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.