![]() |
drop down list boxes in excel
I have an excel sheet that is going to act like a form. Is it possible to have 2 drop down list box. The second list of selections change dynamically on what was selected from the 1st list. Both lists are pulled from an ORACLE database. Can anyone point me in the right direction? Thanks, -- RycherX ------------------------------------------------------------------------ RycherX's Profile: http://www.excelforum.com/member.php...o&userid=34236 View this thread: http://www.excelforum.com/showthread...hreadid=539877 |
drop down list boxes in excel
RycherX, see if this will help,
http://www.contextures.com/xlDataVal02.html -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "RycherX" wrote in message ... I have an excel sheet that is going to act like a form. Is it possible to have 2 drop down list box. The second list of selections change dynamically on what was selected from the 1st list. Both lists are pulled from an ORACLE database. Can anyone point me in the right direction? Thanks, -- RycherX ------------------------------------------------------------------------ RycherX's Profile: http://www.excelforum.com/member.php...o&userid=34236 View this thread: http://www.excelforum.com/showthread...hreadid=539877 |
drop down list boxes in excel
I can't list the items by hand. They must be dynamically created from a database connection. Is this still possible. Sorry, I'm an excel newbie. -- RycherX ------------------------------------------------------------------------ RycherX's Profile: http://www.excelforum.com/member.php...o&userid=34236 View this thread: http://www.excelforum.com/showthread...hreadid=539877 |
drop down list boxes in excel
I am using this code to do it:
Note you will need to add a reference to (Your versions may differ) Microsoft ActiveX Data Objects 2.8 Library Option Explicit Private Sub Workbook_Open() 'is run when workbook opens Dim rsRef As ADODB.Recordset Dim cnRef As ADODB.Connection Dim sqlRef As String 'Instantiate objects Set rsRef = New ADODB.Recordset Set cnRef = New ADODB.Connection cnRef.ConnectionString = "DSN={LOCAL-DSN};Uid={USER};Pwd={PASSWORD}" cnRef.Open 'sqlRef = "Select * [OR Field List] FROM {DATA-TABLE}" sqlRef = "Select * FROM {DATA-TABLE}" 'returns all fields and all records sqlRef = "Select Field1, Field2 FROM {DATA-TABLE}" 'returns only Field1 and Field2 but ALL records 'Other options available with SQL - SELECT statement rsRef.Open sqlRef, cnRef, adOpenStatic, adLockReadOnly If rsRef.RecordCount 0 Then frmInput.cboInput.Clear 'clears combo box Load frmInput rsRef.MoveFirst 'goes to first record Do While Not rsRef.EOF 'do while records remain ' Next line adds items to combo box frmInput.cboInput.AddItem rsRef.Fields("Field1").Value rsRef.MoveNext 'moves to next record Loop 'continues the loop while records remain frmInput.Show vbModal 'displays my form End If End Sub -- Wendell A. Clark, BS Nurses Unlimited, Inc. 432-550-1700 x126 ------------------------------------- CONFIDENTIALITY NOTICE: This e-mail communication and any attachments may contain confidential and privileged information for the use of the designated recipients named above. If you are not the intended recipient, please notify us by reply e-mail. You are hereby notified that you have received this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its contents is prohibited. If you have received this communication in error, please destroy all copies of this communication and any attachments. Contact the sender if it continues. "RycherX" wrote in message ... I can't list the items by hand. They must be dynamically created from a database connection. Is this still possible. Sorry, I'm an excel newbie. -- RycherX ------------------------------------------------------------------------ RycherX's Profile: http://www.excelforum.com/member.php...o&userid=34236 View this thread: http://www.excelforum.com/showthread...hreadid=539877 |
All times are GMT +1. The time now is 12:42 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com