form related problem

dpotts

Registered User.
Local time
Yesterday, 18:32
Joined
Jul 3, 2008
Messages
10
I'm trying to write an sql statement that switches on a forms combo box text. Here is what I have right now.

Code:
SELECT tblLMB.Title, tblLMB.March, tblLMB.Overture, tblLMB.Patriotic
FROM tblLMB
WHERE (((IIf([Forms]![frmLMBSearch]![cmbStyle].[enabled]=True,([Forms]![frmLMBSearch]![cmbStyle].[Value])=True))<>False));
Since the styles have to be in different fields I'm trying to get the checked records based on whatever the combo box has selected.

The point where I'm running into troubles is here: ([Forms]![frmLMBSearch]![cmbStyle].[Value])=True, This just won't work and I'm sure there is an easy way to do it I just can't think of it right now.

Any help would be welcomed.


-Dave
 
I'm not real clear on what you are doing. When a user selects something from the combo box, you want to show styles related to that choice?
 
I'm not real clear on what you are doing. When a user selects something from the combo box, you want to show styles related to that choice?

Yes. And each style is saved in a different Yes/No field with different field names based on style (march, overture, etc.). So I'm trying to filter the table by what is selected in the combo box.
 
It sounds like the styles should be records in a separate but related table rather than several fields within a table. What is your first combo box based on and how do the records relate to the styles? I would be very curious to see your table structure. Can you provide that? Or can you zip & post your database (with any sensative data removed)?
 

Users who are viewing this thread

Back
Top Bottom