By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,444 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

Creating a keyboard

P: n/a
Please help i am hitting my head against a wall here.

I am creating a database to use with a touchscreen and i have created
a pop up keyboard. I have got stuck on two things.

Firstly when i am hitting the keys, the letter is being added to a
text box fine but the cursor is jumping back to the beginning
everytime. When i hit the next letter it is being added to the end of
the text fine. The problem is that when i want to enter the command
space(1) into the code, i can see it add it to the text string but
when the next letter is added it is though it is not there and just
ends up in a string of letters with no space.

How can i make the code so that when i am typing it is leaving the
cursor at the end? Here is a simple part of my code for the letter Z
and the space.

Private Sub Letter_Z_Click()
On Error GoTo Err_Letter_Z_Click
Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text + "Z"
Exit_Letter_Z_Click:
Exit Sub
Err_Letter_Z_Click:
MsgBox Err.Description
Resume Exit_Letter_Z_Click
End Sub
Private Sub Space_Bar_Click()
On Error GoTo Err_Space_Bar_Click
Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text + space(1)
Exit_Space_Bar_Click:
Exit Sub
Err_Space_Bar_Click:
MsgBox Err.Description
Resume Exit_Space_Bar_Click
End Sub

Once i can make the cursor appear at the end i can proceed to my next
problem.

The other problem that i have is i need to create a button that can
delete one character at a time. It is easy to create a button that can
make the field null but i don't wish to do all of it only the last
character.

Hope some one out there can help.

Thanks James
Jul 27 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
"Burden" <ja**********@sonic-comms.comwrote in message
news:04**********************************@a1g2000h sb.googlegroups.com...
Please help i am hitting my head against a wall here.

I am creating a database to use with a touchscreen and i have created
a pop up keyboard. I have got stuck on two things.

Firstly when i am hitting the keys, the letter is being added to a
text box fine but the cursor is jumping back to the beginning
everytime. When i hit the next letter it is being added to the end of
the text fine. The problem is that when i want to enter the command
space(1) into the code, i can see it add it to the text string but
when the next letter is added it is though it is not there and just
ends up in a string of letters with no space.

How can i make the code so that when i am typing it is leaving the
cursor at the end? Here is a simple part of my code for the letter Z
and the space.

Private Sub Letter_Z_Click()
On Error GoTo Err_Letter_Z_Click
Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text + "Z"
Exit_Letter_Z_Click:
Exit Sub
Err_Letter_Z_Click:
MsgBox Err.Description
Resume Exit_Letter_Z_Click
End Sub
Private Sub Space_Bar_Click()
On Error GoTo Err_Space_Bar_Click
Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text + space(1)
Exit_Space_Bar_Click:
Exit Sub
Err_Space_Bar_Click:
MsgBox Err.Description
Resume Exit_Space_Bar_Click
End Sub

Once i can make the cursor appear at the end i can proceed to my next
problem.
Well the first thing I suggest is that you use the ampersand (&) for your
string concatentation rather than plus.

If that doesn't fix it, try inserting:

Me!Enter_Box.SelStart = Len(Me!Enter_Box.Text) + 1

after adding to the .Text property.
>
The other problem that i have is i need to create a button that can
delete one character at a time. It is easy to create a button that can
make the field null but i don't wish to do all of it only the last
character.
With Me!Enter_Box
.Text = Left(.Text, Len(.Text) - 1)
End With
>
Hope some one out there can help.

Thanks James

Jul 27 '08 #2

P: n/a
On 27 Jul, 13:32, "Stuart McCall" <smcc...@myunrealbox.comwrote:
"Burden" <james.bur...@sonic-comms.comwrote in message

news:04**********************************@a1g2000h sb.googlegroups.com...


Please help i am hitting my head against a wall here.
I am creating a database to use with a touchscreen and i have created
a pop up keyboard. I have got stuck on two things.
Firstly when i am hitting the keys, the letter is being added to a
text box fine but the cursor is jumping back to the beginning
everytime. When i hit the next letter it is being added to the end of
the text fine. The problem is that when i want to enter the command
space(1) into the code, i can see it add it to the text string but
when the next letter is added it is though it is not there and just
ends up in a string of letters with no space.
How can i make the code so that when i am typing it is leaving the
cursor at the end? Here is a simple part of my code for the letter Z
and the space.
Private Sub Letter_Z_Click()
On Error GoTo Err_Letter_Z_Click
* *Me!Enter_Box.SetFocus
* *Me!Enter_Box.Text = Enter_Box.Text + "Z"
Exit_Letter_Z_Click:
* *Exit Sub
Err_Letter_Z_Click:
* *MsgBox Err.Description
* *Resume Exit_Letter_Z_Click
End Sub
Private Sub Space_Bar_Click()
On Error GoTo Err_Space_Bar_Click
* *Me!Enter_Box.SetFocus
* *Me!Enter_Box.Text = Enter_Box.Text + space(1)
Exit_Space_Bar_Click:
* *Exit Sub
Err_Space_Bar_Click:
* *MsgBox Err.Description
* *Resume Exit_Space_Bar_Click
End Sub
Once i can make the cursor appear at the end i can proceed to my next
problem.

Well the first thing I suggest is that you use the ampersand (&) for your
string concatentation rather than plus.

If that doesn't fix it, try inserting:

Me!Enter_Box.SelStart = Len(Me!Enter_Box.Text) + 1

after adding to the .Text property.
The other problem that i have is i need to create a button that can
delete one character at a time. It is easy to create a button that can
make the field null but i don't wish to do all of it only the last
character.

With Me!Enter_Box
* * .Text = Left(.Text, Len(.Text) - 1)
End With


Hope some one out there can help.
Thanks James- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -
I have done what you said to make the cursor go to the end and it
works

Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text & "A"
Me!Enter_Box.SelStart = Len(Me!Enter_Box.Text) + 1

I don't understand what you mean in the next part though. Where do i
put the code you mentioned?

James

Jul 27 '08 #3

P: n/a
On 27 Jul, 13:32, "Stuart McCall" <smcc...@myunrealbox.comwrote:
"Burden" <james.bur...@sonic-comms.comwrote in message

news:04**********************************@a1g2000h sb.googlegroups.com...


Please help i am hitting my head against a wall here.
I am creating a database to use with a touchscreen and i have created
a pop up keyboard. I have got stuck on two things.
Firstly when i am hitting the keys, the letter is being added to a
text box fine but the cursor is jumping back to the beginning
everytime. When i hit the next letter it is being added to the end of
the text fine. The problem is that when i want to enter the command
space(1) into the code, i can see it add it to the text string but
when the next letter is added it is though it is not there and just
ends up in a string of letters with no space.
How can i make the code so that when i am typing it is leaving the
cursor at the end? Here is a simple part of my code for the letter Z
and the space.
Private Sub Letter_Z_Click()
On Error GoTo Err_Letter_Z_Click
* *Me!Enter_Box.SetFocus
* *Me!Enter_Box.Text = Enter_Box.Text + "Z"
Exit_Letter_Z_Click:
* *Exit Sub
Err_Letter_Z_Click:
* *MsgBox Err.Description
* *Resume Exit_Letter_Z_Click
End Sub
Private Sub Space_Bar_Click()
On Error GoTo Err_Space_Bar_Click
* *Me!Enter_Box.SetFocus
* *Me!Enter_Box.Text = Enter_Box.Text + space(1)
Exit_Space_Bar_Click:
* *Exit Sub
Err_Space_Bar_Click:
* *MsgBox Err.Description
* *Resume Exit_Space_Bar_Click
End Sub
Once i can make the cursor appear at the end i can proceed to my next
problem.

Well the first thing I suggest is that you use the ampersand (&) for your
string concatentation rather than plus.

If that doesn't fix it, try inserting:

Me!Enter_Box.SelStart = Len(Me!Enter_Box.Text) + 1

after adding to the .Text property.
The other problem that i have is i need to create a button that can
delete one character at a time. It is easy to create a button that can
make the field null but i don't wish to do all of it only the last
character.

With Me!Enter_Box
* * .Text = Left(.Text, Len(.Text) - 1)
End With


Hope some one out there can help.
Thanks James- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -
Also could you tell me how i insert a space.
I have tried :

Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text & " "
Me!Enter_Box.SelStart = Len(Me!Enter_Box.Text) + 1

&

Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text & chr$(127)
Me!Enter_Box.SelStart = Len(Me!Enter_Box.Text) + 1

&

Me!Enter_Box.SetFocus
' Me!Enter_Box.Text = Enter_Box.Text & " "
Me!Enter_Box.SelStart = Len(Me!Enter_Box.Text) + 2

Just wont add a space character. With the first one you can see the
cursor jump, but there is no space.
Jul 27 '08 #4

P: n/a
"Burden" <ja**********@sonic-comms.comwrote in message
news:05**********************************@w7g2000h sa.googlegroups.com...
On 27 Jul, 13:32, "Stuart McCall" <smcc...@myunrealbox.comwrote:
"Burden" <james.bur...@sonic-comms.comwrote in message

news:04**********************************@a1g2000h sb.googlegroups.com...


Please help i am hitting my head against a wall here.
I am creating a database to use with a touchscreen and i have created
a pop up keyboard. I have got stuck on two things.
Firstly when i am hitting the keys, the letter is being added to a
text box fine but the cursor is jumping back to the beginning
everytime. When i hit the next letter it is being added to the end of
the text fine. The problem is that when i want to enter the command
space(1) into the code, i can see it add it to the text string but
when the next letter is added it is though it is not there and just
ends up in a string of letters with no space.
How can i make the code so that when i am typing it is leaving the
cursor at the end? Here is a simple part of my code for the letter Z
and the space.
Private Sub Letter_Z_Click()
On Error GoTo Err_Letter_Z_Click
Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text + "Z"
Exit_Letter_Z_Click:
Exit Sub
Err_Letter_Z_Click:
MsgBox Err.Description
Resume Exit_Letter_Z_Click
End Sub
Private Sub Space_Bar_Click()
On Error GoTo Err_Space_Bar_Click
Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text + space(1)
Exit_Space_Bar_Click:
Exit Sub
Err_Space_Bar_Click:
MsgBox Err.Description
Resume Exit_Space_Bar_Click
End Sub
Once i can make the cursor appear at the end i can proceed to my next
problem.

Well the first thing I suggest is that you use the ampersand (&) for your
string concatentation rather than plus.

If that doesn't fix it, try inserting:

Me!Enter_Box.SelStart = Len(Me!Enter_Box.Text) + 1

after adding to the .Text property.
The other problem that i have is i need to create a button that can
delete one character at a time. It is easy to create a button that can
make the field null but i don't wish to do all of it only the last
character.

With Me!Enter_Box
.Text = Left(.Text, Len(.Text) - 1)
End With


Hope some one out there can help.
Thanks James- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -
I have done what you said to make the cursor go to the end and it
works
Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text & "A"
Me!Enter_Box.SelStart = Len(Me!Enter_Box.Text) + 1

I don't understand what you mean in the next part though. Where do i
put the code you mentioned?
Put the code in the OnClick of the button you mentioned. However, a little
alteration is needed:

With Me!Enter_Box
.SetFocus
.Text = Left(.Text, Len(.Text) - 1)
End With
Jul 27 '08 #5

P: n/a
"Burden" <ja**********@sonic-comms.comwrote in message
news:fa**********************************@8g2000hs e.googlegroups.com...
On 27 Jul, 13:32, "Stuart McCall" <smcc...@myunrealbox.comwrote:
"Burden" <james.bur...@sonic-comms.comwrote in message

news:04**********************************@a1g2000h sb.googlegroups.com...


Please help i am hitting my head against a wall here.
I am creating a database to use with a touchscreen and i have created
a pop up keyboard. I have got stuck on two things.
Firstly when i am hitting the keys, the letter is being added to a
text box fine but the cursor is jumping back to the beginning
everytime. When i hit the next letter it is being added to the end of
the text fine. The problem is that when i want to enter the command
space(1) into the code, i can see it add it to the text string but
when the next letter is added it is though it is not there and just
ends up in a string of letters with no space.
How can i make the code so that when i am typing it is leaving the
cursor at the end? Here is a simple part of my code for the letter Z
and the space.
Private Sub Letter_Z_Click()
On Error GoTo Err_Letter_Z_Click
Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text + "Z"
Exit_Letter_Z_Click:
Exit Sub
Err_Letter_Z_Click:
MsgBox Err.Description
Resume Exit_Letter_Z_Click
End Sub
Private Sub Space_Bar_Click()
On Error GoTo Err_Space_Bar_Click
Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text + space(1)
Exit_Space_Bar_Click:
Exit Sub
Err_Space_Bar_Click:
MsgBox Err.Description
Resume Exit_Space_Bar_Click
End Sub
Once i can make the cursor appear at the end i can proceed to my next
problem.

Well the first thing I suggest is that you use the ampersand (&) for your
string concatentation rather than plus.

If that doesn't fix it, try inserting:

Me!Enter_Box.SelStart = Len(Me!Enter_Box.Text) + 1

after adding to the .Text property.
The other problem that i have is i need to create a button that can
delete one character at a time. It is easy to create a button that can
make the field null but i don't wish to do all of it only the last
character.

With Me!Enter_Box
.Text = Left(.Text, Len(.Text) - 1)
End With


Hope some one out there can help.
Thanks James- Hide quoted text -

- Show quoted text -- Hide quoted text -

- Show quoted text -
Also could you tell me how i insert a space.
<snip>

Have you tried Chr$(160) ?
Jul 27 '08 #6

P: n/a
On 27 Jul, 14:15, "Stuart McCall" <smcc...@myunrealbox.comwrote:
"Burden" <james.bur...@sonic-comms.comwrote in message

news:fa**********************************@8g2000hs e.googlegroups.com...
On 27 Jul, 13:32, "Stuart McCall" <smcc...@myunrealbox.comwrote:


"Burden" <james.bur...@sonic-comms.comwrote in message
news:04**********************************@a1g2000h sb.googlegroups.com...
Please help i am hitting my head against a wall here.
I am creating a database to use with a touchscreen and i have created
a pop up keyboard. I have got stuck on two things.
Firstly when i am hitting the keys, the letter is being added to a
text box fine but the cursor is jumping back to the beginning
everytime. When i hit the next letter it is being added to the end of
the text fine. The problem is that when i want to enter the command
space(1) into the code, i can see it add it to the text string but
when the next letter is added it is though it is not there and just
ends up in a string of letters with no space.
How can i make the code so that when i am typing it is leaving the
cursor at the end? Here is a simple part of my code for the letter Z
and the space.
Private Sub Letter_Z_Click()
On Error GoTo Err_Letter_Z_Click
Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text + "Z"
Exit_Letter_Z_Click:
Exit Sub
Err_Letter_Z_Click:
MsgBox Err.Description
Resume Exit_Letter_Z_Click
End Sub
Private Sub Space_Bar_Click()
On Error GoTo Err_Space_Bar_Click
Me!Enter_Box.SetFocus
Me!Enter_Box.Text = Enter_Box.Text + space(1)
Exit_Space_Bar_Click:
Exit Sub
Err_Space_Bar_Click:
MsgBox Err.Description
Resume Exit_Space_Bar_Click
End Sub
Once i can make the cursor appear at the end i can proceed to my next
problem.
Well the first thing I suggest is that you use the ampersand (&) for your
string concatentation rather than plus.
If that doesn't fix it, try inserting:
Me!Enter_Box.SelStart = Len(Me!Enter_Box.Text) + 1
after adding to the .Text property.
The other problem that i have is i need to create a button that can
delete one character at a time. It is easy to create a button that can
make the field null but i don't wish to do all of it only the last
character.
With Me!Enter_Box
.Text = Left(.Text, Len(.Text) - 1)
End With
Hope some one out there can help.
Thanks James- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
Also could you tell me how i insert a space.

<snip>

Have you tried Chr$(160) ?- Hide quoted text -

- Show quoted text -
Cheers mate. I thought the code was 127. Don't know where i got that
from.

Works great now. I will be coming back to you for any further problems
you know your stuff.
Jul 27 '08 #7

P: n/a
Works great now. I will be coming back to you for any further problems
you know your stuff.
No problem. Glad to help, anytime.

Take a look at this page:

http://www.smccall.demon.co.uk/Keyboard.htm

I think you might find some of those functions useful.
Jul 27 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.