Combo Column Reference

tonyb

Registered User.
Local time
Today, 21:07
Joined
Sep 10, 2001
Messages
10
I have a combo box which has 4 columns. The bound column is col 1 but I need to refer to columns 3 and 4 in a query in order to use the values they contain as parameters. Cols 3 and 4 contain dates i.e. start and finish dates. I want the query to find records that have dates between the 2 dates in cols 3 and 4.

Is there a way of doing this? Thanks in advance.
 
Add two unbound hidden text boxes to your form; call them txt1 and txt2 say for simplicity.
Set the control source of txt1 to =[MyComboName].[Column](2)
and to =[MyComboName].[Column](3) resp., where column2 is actually column3 etc.
In the criteria for the date field put Between[Forms]![MyFormName]![txt1] And [Forms]![MyFormName]![txt2]
You may also have to specifically define the parameters.
Hopefully this is informative enough to gain "heavyweight" status, no on second thoughts the title's not appropriate
:rolleyes:
 
Thanks, Rich - Worked a treat!
 

Users who are viewing this thread

Back
Top Bottom