Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a userform that has a combobox for car makes, and I want to make
it so that when a make is selected, the box below it will be populated with the models of that make. I already have the makes populating the make comboboxes using ADO on the UserForm_Initialize event. I already have a table with all of the make/model info, there is a column of models with a column that contains their makes, and to pull the makes, i just SELECT DISTINCT Makes. I tried making the ComboBox_change event connect and query the database with the ComboBox.Text, but that causes all sorts of annnoying ridiculously-hard-to-debug errors, and I am thinking that there must be a smoother way to do this. Is there an event that occurs after the text is changed and then idles? or is there a way I can make a combobox intrinsically tied to an incomplete query, where the above box plugs the missing link into the incomplete query and then connects and retrieves the data? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about the Enter event of the second combobox?
-- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Tobi" wrote in message ups.com... I have a userform that has a combobox for car makes, and I want to make it so that when a make is selected, the box below it will be populated with the models of that make. I already have the makes populating the make comboboxes using ADO on the UserForm_Initialize event. I already have a table with all of the make/model info, there is a column of models with a column that contains their makes, and to pull the makes, i just SELECT DISTINCT Makes. I tried making the ComboBox_change event connect and query the database with the ComboBox.Text, but that causes all sorts of annnoying ridiculously-hard-to-debug errors, and I am thinking that there must be a smoother way to do this. Is there an event that occurs after the text is changed and then idles? or is there a way I can make a combobox intrinsically tied to an incomplete query, where the above box plugs the missing link into the incomplete query and then connects and retrieves the data? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I tried making a Model1_Enter event, and i get the error message:
"Compile error: Expected user-defined type, not project" I am not sure what to do, what I have is a function that connects to the SQL Server via ADO, and the function takes in a SQL String as a query, and then attempts to execute the query, and on error returns false, so it trys and trys until the user gives a string that queries cleanly, then returns the recordset. Is there a comprehensive list of events in VB/VBA? I have the O'Reilly VB/VBA in a nutshell book, and there is no list there, nor have I been able to find one through search. I am stuck. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Tobi" wrote in message oups.com... I tried making a Model1_Enter event, and i get the error message: "Compile error: Expected user-defined type, not project" I am not sure what to do, what I have is a function that connects to the SQL Server via ADO, and the function takes in a SQL String as a query, and then attempts to execute the query, and on error returns false, so it trys and trys until the user gives a string that queries cleanly, then returns the recordset. I can't really help you with as little detail as that. Compilere error, where in the code, I'm supposed to know? Is there a comprehensive list of events in VB/VBA? I have the O'Reilly VB/VBA in a nutshell book, and there is no list there, nor have I been able to find one through search. I am stuck. If you go into the VBIDE, and view code in the Userform. Select one of the Combobox event procedures already there and then in the dropdown at the top right of the code module, click on that and you see all events available for a combobox. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you go into the VBIDE, and view code in the Userform. Select one of the
Combobox event procedures already there and then in the dropdown at the top right of the code module, click on that and you see all events available for a combobox. Oh whoa, I totally missed that, thank you, I will more than likely be able to figure this one out. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Weird Error with ComboBox_Change() | Excel Programming | |||
Combobox_change does not repond? | Excel Programming | |||
Combobox_change event problem | Excel Programming | |||
ComboBox_Change sub runs unexpectedly | Excel Programming | |||
Combox box question | Excel Programming |