Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Developing an Access Program for Touchscreen 1

Status
Not open for further replies.

ojasg

Technical User
Mar 19, 2010
30
0
0
DE
I am in process of completing a program for use on a touchscreen computer (It will not have a keyboard or Mouse). I created buttons that act as keyboard on some forms which work fine.

What I am Struggling With -
I have 3 different fields on my form named frmSc.
The fields are - FSc, MSc, OSc
When the focus moves on one of the fields, a hidden form becomes visible. This form named frmNumericKeypad has buttons from 0 - 9. When the user clicks on one of the buttons the caption value of the button is passed to the field that had the focus on the frmSc.

I know this might be too complex...But I am sure there are a few programmers here who have dealt with such a situation. Any suggestions are most welcome.. I have intermediate skills with VBA.

The code that works when clicking on the same form -
---------------------------------------
Function addletter()

ActualQty.Value = ActualQty.Value & Screen.ActiveControl.Caption

End Function

'This code is repeated for each button on its click event
Private Sub cmdbtn0_Click()

addletter

End Sub
---------------------------------

Thank You Very Much!
 
So, what is the issue? You've told us what it does, or what it's supposed to do, but you've not told us what IS going on, or what errors you're getting.
 
When I have done something like this I used a label on the keypad form and included a backspace button and an enter button, and a clear button. Button clicks on the keypad just update the label caption. Only when the enter button is clicked do I send the result to the target control.

Users often want to correct a character or clear their entries and start over. That gets more complicated when you are doing it one character at a time on another form.
 
@ kjv1611 - My issues was in accomplishing what I just mentioned. I have sated how it should work.. I dont get errors, I just didn't know how to do it. So to answer your question nothing was going on! I just had an idea and needed help with excuting it.

@Golom - Yes I used that approach and I am able to send values from frmNumericKeypad to frmSc. I am going to play around a bit more to test the roboustness of my code and will post it if it works.

Thanks a lot... :)
 
I am working with ojasg on the numeric pad and here is the code i have so far.

Private Sub cmdbtnEnterNumber_Click()

Dim crtControl As Control

Form_frmsc.SetFocus
Set crtControl = Screen.ActiveControl

If crtControl.Name = "Text0" Then
Form_frmsc.Text0.Value = txtbxinput.Value
ElseIf crtControl.Name = "Text2" Then
Form_frmsc.Text2.Value = txtbxinput.Value
End If

DoCmd.Close acForm, "frmNumericKeyPad", acSaveNo

End Sub

This is the code for the enter number button on the Numeric Keypad form and the txtbxinput is the number that will be passed to frmsc. Text0 and Text2 are two textboxes on frmsc. The problem I am having is the line of code Form_frmsc.SetFocus is just for form sc and there are several forms that will use this keyapd. I am wanting to make this generic to work with any form. Thanks for any help.
 
Private Sub cmdbtnEnterNumber_Click()
Dim crtControl As Control
Set crtControl = Screen.ActiveControl
crtControl.value = txtbxinput.Value
DoCmd.Close acForm, "frmNumericKeyPad"
End Sub
 
@MajP - thanks for the reply. I tried to run the code you supplied, but I keep getting the error that "Object doesn't support this property or method. It has to do with crtControl.Value. Thanks.
 
The order seems strange from your original code. What is the active control when the code fires? My guess it is the cmd button not the text box.

You may want to do this with a global variable. In a standard model, you could have something like:

public glblRtnControl as access.control

then in the code that opens this hidden form
glblRtnControl = me.yourControlName

Then in the above code.
Private Sub cmdbtnEnterNumber_Click()
glblRtnControl.value = txtbxinput.Value
DoCmd.Close acForm, "frmNumericKeyPad"
End Sub
 
@MajP - Thanks for the help. I just had to make sure to put the code "Set glblRtnControl = me.yourControlName" in the code that opens the form. Works like a charm.
 
@MajP - Thanks again! You came to the rescue once more!

Thatnks to others who contributed to discussion as well.

This code really works well! Very neat .. Our complete database now operates without a keyboard or mouse!
Thanks a lot!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top