Results 1 to 3 of 3
  1. #1
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Linking Table Name in From Clause (A2K SR1)

    How would you link the tabe name in the From Clause of a SQL statement to a Combo Box. I.e., Select * from TableA; The name TableA will be the whatever name is selected in a Combo Box. Thus, each time a new selection is made on the combo box, an event will run the query to provide a data set from the table selected.
    Regards,

    Gary
    (It's been a while!)

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Linking Table Name in From Clause (A2K SR1)

    strSQL = "Select * from " & Me.comboName
    If you combo has more the 1 column use
    strSQL = "Select * from " & Me.comboName.Column(x)
    where x is the number of the column where the name is in, beginning to tell with 0 for column 1, 1 for column 2,...
    Francois

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Linking Table Name in From Clause (A2K SR1)

    Thanks again for your help. <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>
    Regards,

    Gary
    (It's been a while!)

Posting Permissions

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