Combo Box question

BrianFawcett

Registered User.
Local time
Today, 05:36
Joined
May 3, 2010
Messages
63
I have a form where users can populate two combo box from drop down menus: Conflict Reason and Conflict Details.

I want to make the choices available for the Conflict Details cb dependent upon the choice the user made in the Conflict Reason cb.

I tried the follow SQL for the Row Source for the Conflict Details cb, but I keep coming up with a syntax error:

SELECT [Reference Table - Conflict Details].Details FROM [Reference Table - Conflict Details]
WHERE [Reference Table - Conflict Details].Reason = Forms!Update Form![Conflict Reason]
ORDER BY [Reference Table - Conflict Details].[Details];

Can anyone help me?
 
That looks about right, but you probably need to bracket the form name due to the inadvisable space (like you had to do the table due to the inadvisable spaces and symbol). Here's a sample if you need it:

http://www.baldyweb.com/CascadingCombo.htm
 
Thanks, Your code for the second option can just go into the Row Source of the dependent Combo Box, correct?
 
The method that you were using would have a query/SQL referring to the first combo as the row source, and the only code required would be the Requery. The other method is a little more code based.
 
OK, Not to sound dense, but where in the Combo Box properties would the second solution code reside?
 
Did you check out the sample db? Both methods use the After Update event of the first combo.
 
And when looking at the sample Paul gave. you need to pay particular attention to the syntax for the WHERE portion of your SQL statement. I suspect that's where your problem lies.

Linq ;0)>
 
Pbaldy, Thanks so much. I use the requery code and the sql statement and it works great. I will definitely be using this again.
 
Glad you got it working! Keep in mind that the syntax of the WHERE portion of the SQL statement varies, depending on whether the Datatype of the field is Text or Number.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom