Results 1 to 4 of 4

Thread: [RESOLVED] Associating a recordset field with a control in a SQL JOIN code

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    475

    Resolved [RESOLVED] Associating a recordset field with a control in a SQL JOIN code

    Suppose I have a SQL JOIN code, how can I refer to the recordset fields when I want to associate some controls on the form with this code programmatically? Assume my code is

    VB Code:
    1. SELECT orderDetails.orderId,orderDetails.ProductId, orderDetails.UnitPrice, products.ProductName FROm orderDetails INNER JOIN products ON orderDetails.ProductId = products.ProductId
    eg

    txtName.text = rst!(field) what will the recordset field be?

    Thanks

  2. #2
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    266

    Re: Associating a recordset field with a control in a SQL JOIN code

    it would be like
    rst!("orderid") or rst!("productid") etc

  3. #3
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    266

    Re: Associating a recordset field with a control in a SQL JOIN code

    ur field name would be the same as u have in ur select list but u dont need to mention table name with field names

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    May 2006
    Posts
    475

    Re: Associating a recordset field with a control in a SQL JOIN code

    Sorry I have to take you back on this. I thought I had this working but I have realised that the controls associated with this recordset are not displaying the required data. What could be the problem? Am using :-
    txtPatron.Text = rst!("LastName")

Posting Permissions

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



Click Here to Expand Forum to Full Width