How I can take text and no number in result that arises from a combo-box into a searc

iliast

Registered User.
Local time
Today, 16:32
Joined
May 21, 2007
Messages
26
How I can take text and no number in result that arises from a combo-box into a search form?
 
Your combo will typically have more than one column, though one or more colums may be hidden. I suspect you need to refer to the relevant colum. Look this up in Access Help. Remember that columns are numbered from 0, so the first column is column(0), the second is column(1), etc.
 
Your combo will typically have more than one column, though one or more colums may be hidden. I suspect you need to refer to the relevant colum. Look this up in Access Help. Remember that columns are numbered from 0, so the first column is column(0), the second is column(1), etc.

Into the combo box in criteria, I did exactly you wrote. I changed the first column to 0. My problem is in the results.
 
I can't help without you explaining what the problem is.
 
Example Neil: I have a table of months. I have also a search form where the criterion of the month exist and i made a combo box to make the insertion of months easier. Into that combo box i managed to eliminate the MonthID by setting the width of the ID column to zero. So, now when i choose "April" in the combo box, remains "April" and not the ID number "4", even the cursor isn't into the month-criterion field. But after the applying of the filter (after the end of search and the appearance of the results), the column "Month" in the results above is full with "4" and not "April". How can i make to take result which contains text (the name of the month) and not number (the month ID)? That's the question.
 
neil explained

even though the month index column is hidden, its still there

so if you just use

varname = mycombobox, it will give you the month number

you need to reference the correct column so

varname = mycombobox.columns(0), is the same as the above
varname = mycombobox.columns(1), is the second column -ie the month name
varname = mycombobox.columns(2), is the third column etc
 

Users who are viewing this thread

Back
Top Bottom