Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cascading comboboxes

Status
Not open for further replies.

georgp

Technical User
Mar 28, 2002
96
US
Hi,

the problem is somewhat complex - I hope I can describe it clear enough.

I have three unbound comboboxes to allow the user to filter the records of a form.

The first combobox 'fields' displays the field list of the related underlying tables in the dropwdown list - most of which are of type 'text', but some are 'number's or 'date's (and here comes the problem). The recordsource is of type 'field list'.
The second combobox 'criteria' has a value list with the search criteria, like '=', '>' or '<>' in the drowdown list.
The (problematic) third combobox 'value' has a recordsource with the actual values of the field which has been selected with combobox 'fields', and can either show text, numbers or dates in the dropdown list.
All comboboxes are limited-to-list.
All comboboxes display the text &quot;Select&quot; when fresh - i.e. before the process, and when the process is finished.

Now the problem: in case the third combobox 'value' has displayed strings in the dropdown list there is no problem. It will accept the default &quot;SELECT&quot;, but also number or date entries provided/selected from the actual dropwdown list. However, if it has displayed numbers or dates in a previous run, it does not accept the 'defaultvalue'
&quot;SELECT&quot; or any other string, just again dates or numbers, respectively.

My question: is there any way to ''clear'' the combobox, so that it takes any value provided from the recordsource (but limit to list is kept)?

Thanks for any input, have spent many unfruitful hours on this...

georgp
 
Hello,

I dont know if that helps but look at

thread702-559309
 
DiOgenes, thanks a lot.
Unfortunately, it is not the solution to my problem.
Actually, I have found a somewhat similar form at Rogers Access Library


The form is basically identical to the one I have developed (I point to this form, because my search form is part of a pretty complex form, which might raise problems to focus on this issue).

If you download the file and select in the 'CreateQuery' form the table 'tblHoliday' from the dropdown list and then the FieldName 'HDate' from the dropdown list, a '=' from the next dropdown list, and any date from the 'Criteria' dropdown list (the table field related to combobox 'Criteria' would then be of type 'date')and run the query, it works. After using the 'Reset' button and selecting the FieldName 'Holiday' from the dropdown list of the same table 'tblHoliday', again '=' and then any item from the rowsource of combobox 'Criteria' (in this case the table field is type text), it fails, with a message indicating that the value is not in the list. Basically, the process stucks and you have to press the escape button or close the form.
This is because the rowsource still is related to date type items (as you can see when the selected string pops into the box).
I believe, I have the same problem.

As I did not have any progress any further help is appreciated.

Thanks, georgp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top