473,320 Members | 1,846 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,320 software developers and data experts.

Simple screen keyboard for Access.

44
Hi all;
Quick question for you - is there any way of building my own on-screen keyboard onto a form? My VB isn't so good so any simple solutions would be great! The Windows keyboard isn't viable, there's too many buttons and I need to be able to modify the layout.

Any ideas?

thanks!
Feb 8 '09 #1
6 8627
NeoPa
32,556 Expert Mod 16PB
You could create a form with various Command Button controls - each of which represents one of the characters you want to make available on your keyboard.

Unfortunately, you would have to handle the focus manually, as clicking on any of them changes it to that Command Button.

Alternatively, if you made them all Label controls instead, you might have an easier ride.

Welcome to Bytes!
Feb 8 '09 #2
Whizzo
44
Thanks for the quick reply - I've been experimenting a little in the meantime. I've managed to set the value of a text box using a simple On Click event of

me!Name = me!command1.caption.

So if you click the button with A on it then A appears in the name box. I can see a way forward but typing in me!command???.caption for each and every letter will drive me nuts! There must be a more elegant solution! What about a piece of form-level code, where a click on one of the keyboard buttons sends its caption as a variable for the form-level procedure to apply? Can this be done?
Feb 8 '09 #3
Whizzo
44
Right, I've had a bit more success. I can now copy the same little macro to every button which invokes a module, below:
Expand|Select|Wrap|Line Numbers
  1. Forms!frmValues!Name.SetFocus
  2. SendKeys Screen.PreviousControl.Caption
Should be simple, yes? Well the problem is that every time the focus moves to the Name field I imagine it gets highlighted too. And we all know what happens if you highlight a bit of text them press a key - it gets overwritten rather than appended to. Any ideas on how to remove the highlighting and send the cursor to the end of the string before sending the keystroke?
Feb 8 '09 #4
NeoPa
32,556 Expert Mod 16PB
In that case you may want to map out an area (grid) of your form and use the MouseDown event of your form.

Unfortunately, Label controls take the MouseDown event rather than the form if they are there.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_MouseDown(Button As Integer, _
  2.                            Shift As Integer, _
  3.                            X As Single, _
  4.                            Y As Single)
  5.  
  6. End Sub
Feb 8 '09 #5
Whizzo
44
Thanks for all the info, I worked out a solution a few minutes ago!

Here's the module, it's run from a macro attached to the OnClick event of each button:

Forms!frmValues!Name.SetFocus 'sets the focus to the text box
Forms!frmValues!Name.SelStart = 0 'un-highlights text box, cursor to LHS
SendKeys "({end})" 'moves the cursor over to the RHS of any existing text
SendKeys Screen.PreviousControl.Caption '"Types" the caption of the command button used to invoke the code.

So happily if the command buttons are captioned Q W E R T Y then that's exactly what appears in the text box. SelStart was the command I was looking for, nothing else worked to un-highlight the damn text after SetFocus did its job!

Thanks for the help!

Hen
Feb 8 '09 #6
NeoPa
32,556 Expert Mod 16PB
@Whizzo
I would call a procedure from all instead personally...
But also use code to add the value (Caption) to the end of the Name control instead of using SendKeys.
Expand|Select|Wrap|Line Numbers
  1. Call Me.Name.SetFocus
  2. Me.Name.Caption = Me.Name.Caption & Screen.PreviousControl.Caption
NB. As this is a label (I assume - for a TextBox it would be either .Text or .Value) it won't take the focus anyway.
Feb 8 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: jonathandrott | last post by:
Hi, i'm kinda new to vb.net and i'm trying to make an on screen keyboard to use with a touch screen. how do i get it to print a letter on the screen when the button is pressed in the textbox that...
4
by: Dennieku | last post by:
Hi, I have to develop an on-screen keyboard and on-screen numeric keypad for a touchscreen UI. The hardest thing with this is that it has to be multi-lingual. Has anybody have ideas how to...
3
by: Dennieku | last post by:
Hi, I have to develop an on-screen keyboard and on-screen numeric keypad for a touchscreen UI. The hardest thing with this is that it has to be multi-lingual. Has anybody have ideas how to...
4
by: Dennieku | last post by:
Hi, I have to develop an on-screen keyboard and on-screen numeric keypad for a touchscreen UI. The hardest thing with this is that it has to be multi-lingual. Has anybody have ideas how to...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.