|
-
Jun 3rd, 2003, 10:08 AM
#3
Let me in ..
Re: Populate a combo box with results from SQL query
Originally posted by run_GMoney
I'm not sure exactly how to go about doing this. I was hoping the SQL would be something like:
VB Code:
"SELECT gameid FROM game WHERE hometeamid = " & Text1.Text & " OR awayteamid = " & Text1.Text)
That doesn't work, doesn't like breaking the "" like that. So basically, what I'm doing is creating a recordset from one table (team). The values are displayed one at a time in a textbox (Text1). A command button is used to browse through the values. I would hope that I could populate a combo box with the value(s) in another table (game) that matched the Text1.Text. Is it clear what I'm asking for? I'm not even sure if I know what I'm talking about. Anyway, if somebody has an idea of what I'm looking for I'd appreciate it. Thanks
Try this ..
strSql = "SELECT gameid FROM game WHERE (hometeamid = " & Text1.Text & " OR awayteamid = " & Text1.Text & ")"
Then use the variable ....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|