Zigzag
11-08-2007, 11:29 AM
Hi all,
From another post that I have been trying to help with I have a question.
Is it possible to create a querie that has, in a criteria
Like Forms![Form1]![Lookup].Column(1)
Lookup is a combo box with 2 columns
It throw up an error message "Undefined function........."
Any help would be appreciated.
Garry
rainman89
11-08-2007, 11:31 AM
Forms![Form1].[Lookup].Column(1)
not sure if u need the ! or not...
Zigzag
11-08-2007, 11:34 AM
Hi Ray,
Thanx for the fast reply but still the same error message.
Garry
Zigzag
11-08-2007, 11:36 AM
Just to add by the way,
I can use
=Forms![Form1]![Lookup].Column(1)
as a control source in a text box without error.
Garry
rainman89
11-08-2007, 11:58 AM
why are u using a like for the criteria? also with a like youll need a * either before or after the entry
"*" & Forms![Form1]![Lookup].Column(1) & "*"
try something like that
Zigzag
11-08-2007, 12:06 PM
OK forget the like,
Oringinaly I was using it with "*"& etc etc but took them out when I got the error, I just forgot to remove the LIKE
From posts I have managed to find so far I dont think I can use a combo column in a query.
Garry
rainman89
11-08-2007, 12:17 PM
use a dlookup to do it.. might be easier for ya
Zigzag
11-08-2007, 12:24 PM
Good thinking........
Will give it a try.
Garry
boblarson
11-08-2007, 12:27 PM
I have the answer for you on how to do it though with a combo box.
1. Put a hidden text box on your form.
2. For the control source of the text box put =[YourComboBoxName].Column(1)
3. In the query's criteria use [Forms]![YourFormName]![YourTextBoxName]
And that should do it. I got the answer here:
http://support.microsoft.com/kb/93138
rainman89
11-08-2007, 12:27 PM
boB knows all.
i was hoping someone would bail me out:D:D:confused::confused:
Zigzag
11-08-2007, 12:42 PM
Hi Bob,
Thanx for that, I have already used that as a workaround but it starts to get a little messy if I have to have a combo box and then a text box to translate an option group just to use it in a query.
Thanx guys,
I appreciate your help
Garry