Table record to TextBox?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jschmidt
    New Member
    • Jun 2007
    • 47

    Table record to TextBox?

    Hello,

    Is there a way to set the text in a textbox on a form to a specific value in a table in access?

    I need to set txtBox.text = specific value in table

    Thanks to all who can help
  • MindBender77
    New Member
    • Jul 2007
    • 233

    #2
    Originally posted by jschmidt
    Hello,

    Is there a way to set the text in a textbox on a form to a specific value in a table in access?

    I need to set txtBox.text = specific value in table

    Thanks to all who can help
    You can set the controlsource property of the textbox to reflect any value. However, is you form's recordsource bound to the same table that you want to pull data from?

    Bender

    Comment

    • jschmidt
      New Member
      • Jun 2007
      • 47

      #3
      Yes it is bound to the same table. I am not sure how to reference the data though...

      Comment

      • MindBender77
        New Member
        • Jul 2007
        • 233

        #4
        One method would be to use DLookup.

        In the controlsource of your textbox
        Code:
        =DLookup("[FieldName]","TableName","[FieldName] = "Criteria"")
        This is one way but, there are many others. What data are you trying to reference? Basically, what do you want to display in your textbox?

        Bender

        Comment

        • jschmidt
          New Member
          • Jun 2007
          • 47

          #5
          Perfect! Thank you very much. Works Great.

          Comment

          Working...