Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2006
    Posts
    40

    Unanswered: display corresponding textbox value issue

    Hi community experts,

    May I knw whether is it possible to display the corresponding value of the second textbox based on the user input in the first textbox? This means that once the user enters the value of first textbox - S1, the corresponding matching value based on first textbox will be displayed in the second textbox automatically.

    I have tried using the AfterUpdate() event of textbox1 control to trigger this scenario but doesnt seem to be working. Perhaps that is not the correct event for this scenario.

    Alternatively, I have also thinking of using two contols for this scenario, textbox and combo box respectively. Textbox will accept user input and combo box will populate or filter the result (corresponding value) based on the first textbox. Hence, nt too sure as to how that can be achieved. Hence, any advice, direction or code snippets are very much appreciated!

    Scenario

    Student table
    StudentId S1 S2 S3
    Name Peter Shaun Alfred

    Student table view
    StudentId - datatype(text), primary key
    Name - datatype(text)

    Form design

    Student profile

    StudentId - unbounded textbox1
    Name - unbounded textbox2

    or

    StudentId - unbounded textbox1
    Name - unbounded combo box1

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Yes you can ... What were you doing in the AfterUpdate event?

    BTW, that is where you want to do this action ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    May 2005
    Posts
    1,191
    May I knw whether is it possible to display the corresponding value of the second textbox based on the user input in the first textbox?
    Just perform a dlookup. In the afterupdate event of your textbox you are changing, then populate the second with the value from the dlookup.
    Alternatively, I have also thinking of using two contols for this scenario, textbox and combo box respectively. Textbox will accept user input and combo box will populate or filter the result (corresponding value) based on the first textbox.
    This would require changing the SQL of the recordsource property of the combobox on the afterupdate event of the textbox again.

    So you can do either, it's just a question of what is the better option in this situation.
    Me.Geek = True

Posting Permissions

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