Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Posts
    9

    Unanswered: Automatically displaying a value in an unbound textbox

    I have a form with a field name [varty_yield] so that when i select one of choices through a combobox, it shows up automatically in the textbox [txtpotentialyield].

    Example:

    NC 134 = 89
    NC42 = 134
    NC 532 = 52
    NC 51 = 26

    I want the variety "NC 134" under fieldname [var_yield] to have an automatic display of "89" to its unbound txtbox [txtpotentialyield]. Thanks for the help . .

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You could simply use:
    Code:
    If Me!var_yield = "NC 134" Then Me.txtpotentialyield.Value = "89" ' By the way, is it var_yield or varty_yield?
    But there must be something more in your question. What's the role of the combobox, and which code do you have now?
    Have a nice day!

  3. #3
    Join Date
    Apr 2010
    Posts
    9
    I was thinking actually of combobox on this and would try 'requery' it using afterupdate(). thank you. for now, i'll try that code u posted above if it works. thank u.

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    The same code will work in the AfterUpdate event of a combo box. The Requery event (for the combobox) is useful when its data set (i.e., the number of rows in the table or query referred to by its RecordSource property) has changed, or after this RecordSource property itself was modified.
    Have a nice day!

Tags for this Thread

Posting Permissions

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