Results 1 to 8 of 8

Thread: Make textbox display dependent on listbox input

  1. #1

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    46

    Make textbox display dependent on listbox input

    Hi All,

    I have 2 fields, Language and Character in my table. Now i am designing a form for it. I am using a list box for all the language n a textbox for the character.

    Wat i wan to achieve is as follows :

    Whenever the user clicks on any of the language in the list box, its corresponding character will be displayed in the textbox. How can i achieve it? thks

    FT

  2. #2
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    372

    Re: Make textbox display dependent on listbox input

    how are you storing all of the available characters?

  3. #3

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    46

    Re: Make textbox display dependent on listbox input

    the available chars are all stored in the table.. i m trying to write a query, n assign the result of the query to the texbox but to no avail..

  4. #4
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    372

    Re: Make textbox display dependent on listbox input

    not sure what you mean by table...
    but using an array of chars named arrChars()

    ' in list1_click
    txtChar=arrChars(list1.listindex)

  5. #5

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    46

    Re: Make textbox display dependent on listbox input

    Quote Originally Posted by rnd me
    not sure what you mean by table...
    but using an array of chars named arrChars()

    ' in list1_click
    txtChar=arrChars(list1.listindex)
    sorry for the confusion, i am using VBA in fact... tat is i have a table to store the 2 fields, language n character...

    Whenever the user clicks on any of the language in the list box, its corresponding character will be displayed in the textbox. How can i achieve it? thks

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Make textbox display dependent on listbox input

    Quote Originally Posted by fulltime
    sorry for the confusion, i am using VBA in fact
    Moved to Office Development.

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Make textbox display dependent on listbox input

    You have 1 character per language? The table has 2 fields, Language and Character?

    VB Code:
    1. "Select Character From <your tablename> Where Language = '" & listbox.text & "'"
    After you execute the select statement, the character you want is in the recordset.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  8. #8

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    46

    Re: Make textbox display dependent on listbox input

    Quote Originally Posted by Al42
    You have 1 character per language? The table has 2 fields, Language and Character?

    VB Code:
    1. "Select Character From <your tablename> Where Language = '" & listbox.text & "'"
    After you execute the select statement, the character you want is in the recordset.
    ok thks

Posting Permissions

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



Click Here to Expand Forum to Full Width