I built a form where a user enters an id and then a SQL statement is run using that id then populates a datagrid. In this case, I set up the connection to a production MS SQL db. However, I would like to add in 4 Select Case statments to point to differenty db's respectively. I have the code built to query the 4 other db's but I do not know how to code the radio buttons (Select Case) to point to a db when selected. I've never used Select Case functionality before so any help would be greatly appreciated.
I built a form where a user enters an id and then a SQL statement is run using that id then populates a datagrid. In this case, I set up the connection to a production MS SQL db. However, I would like to add in 4 Select Case statments to point to differenty db's respectively. I have the code built to query the 4 other db's but I do not know how to code the radio buttons (Select Case) to point to a db when selected. I've never used Select Case functionality before so any help would be greatly appreciated.
Thanks,
J
Set up a control array of option buttons and then try this code:
VB Code:
Private Sub Option1_Click(Index As Integer)
Select Case Index
Case 0
' Option Button 0 selected
Case 1
' Option Button 1 selected
Case 2
' Option Button 2 selected
Case 3
' Option Button 3 selected
End Select
End Sub
Last edited by Mark Gambo; Aug 26th, 2005 at 12:07 PM.
Regards,
Mark
Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."