Results 1 to 5 of 5

Thread: On Screen Keyboard (MS Access 2000-2003)

  1. #1
    Join Date
    Apr 2013
    Posts
    8

    On Screen Keyboard (MS Access 2000-2003)

    Hi everyone,

    Hope someone can help me out with this one. I have created a form that has a text box on the top of the form, a data list in the middle and a set of command buttons on the bottom. The command buttons are organized much like a regular keyboard. Each command button has a letter (a-z). The form is not linked to any table or query. The data list is linked to a table of city names. The idea is as follows:

    When the text box at the top of the form is blank (null or no information), the data list will display all city names in the table. If i want to narrow down the list I can click on a command button with the letter I want, for example, if i click on the command button labeled "s" then that same letter will appear in the text box, the data list will then be re-queried and only the city names starting with the letter "s" will appear.

    That part i have working fine, the problem comes in when i want to append a letter. If I click on any of the other command buttons, the previous letter chosen gets replaced by the new letter being selected. What I would like to know is how to append a letter without deleting what is already there. The code I am using is as follows: The text box at the top is labled "SearchBox1" the data list is labled "DataList1". Thanks, any help would greatly be appreciated.


    Private Sub K01_Click()


    [SearchBox1] = "A"
    DoCmd.Requery "DataList1"


    End Sub

  2. #2
    Join Date
    May 2006
    Posts
    407
    SearchBox1 = SearchBox1 + "A"
    This will add the requested letter. The way you had it, just set the text field to the requested letter, thus it was always a direct replacement.

  3. #3
    Join Date
    Apr 2013
    Posts
    8
    Quote Originally Posted by GolferGuy View Post
    SearchBox1 = SearchBox1 + "A"
    This will add the requested letter. The way you had it, just set the text field to the requested letter, thus it was always a direct replacement.
    awsome!, thank you so much for the info. How would i backspace if i accidentally select the wrong text?

  4. #4
    Join Date
    May 2006
    Posts
    407
    SearchBox1 = Left(SearchBox1, Len(SearchBox1) - 1)

  5. #5
    Join Date
    Apr 2013
    Posts
    8
    Quote Originally Posted by GolferGuy View Post
    SearchBox1 = Left(SearchBox1, Len(SearchBox1) - 1)
    Thank you so so much. You have no idea how much you have helped me.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •