Results 1 to 3 of 3

Thread: record source

  1. #1
    Join Date
    Feb 2009
    Posts
    9

    Unanswered: record source

    how can you assign a value to a textbox from your sql query coded in VBA? i tried it using VB.NET but i don't know if it'll work in access

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so what did you try?
    essentially there is not a huge difference
    mycontrolname.value = myrecordset.columnname
    or
    mycontrolname.value = myrecordset!columnname
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    If you're saying that you trying to look up something in a given table/query, based on another value in your current record, and assign it to your textbox, then you should probably be using the DLookUp() function. You can't assign the results of a Select Query to a textbox in Access VBA.
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Posting Permissions

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