Results 1 to 3 of 3

Thread: Newb Question

  1. #1
    Join Date
    Oct 2002
    Posts
    15

    Unanswered: Newb Question

    How do I get data from a textfield in a form and then use it in a query. Say my variable is a tablename and I need fields from it too. Say my variable is XXX:

    SELECT XXX.PART, XXX.DESCRIPTION
    FROM XXX
    WHERE XXX.PART = "531163"

    I'm getting hung up on syntax...
    -The enemy of good is better...

  2. #2
    Join Date
    Feb 2002
    Location
    San Antonio, TX
    Posts
    69
    Try this out:

    SELECT XXX.PART, XXX.DESCRIPTION FROM XXX WHERE (((XXX.PART)=[Forms]![frmForm1]![txtBox1]));


    Where frmForm1 = your form and txtBox1 = your textbox on your form....
    "Doing stuff is overrated. Take Hitler for example. He did lots but don't we all wish he'd have just stayed home and gotten stoned?"

  3. #3
    Join Date
    Oct 2002
    Posts
    15
    Thanks, I'll try that, also I think I figured out how to do this easier just using a procedure in VB and building a query and so forth. I was having trouble understanding how to use XXX as a variable throughout the query but I think it will be like From "& partsList&" ...etc.


    Originally posted by punkerboy
    Try this out:

    SELECT XXX.PART, XXX.DESCRIPTION FROM XXX WHERE (((XXX.PART)=[Forms]![frmForm1]![txtBox1]));


    Where frmForm1 = your form and txtBox1 = your textbox on your form....
    -The enemy of good is better...

Posting Permissions

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