Question applies to: MS Access 2003
This looks totally weird to me, so I hope that the forum could shed some light on this mystery. I have three comboboxes:
Combo1: value list (manually filled with selected tablenames)
Combo2: field list (automatically filled with all fields of existing selected table in combo1)
Combo3: table/query (automatically filled with all possible values used in the field of combo2)
All comboboxes have "limit to list" property set to "yes" (I did try limit to list "No", though with the same result).
I select the existing table in combo1 and then select a field from that that has FieldType "date" in combo2. After that I select an existing value from the list in combo3. So far so good...
The issue:
I go back to combo2 and select a different field with datatype "Text". With an combo2_afterupdate I reset the value of combo3 to NULL (me.combo3.value = NULL) and I change the rowsource to the new possible values for the new selected field. To be absolutely sure I requery combo3 (combo3.requery).
Selecting a value (which obviously is a string) results in the "limit to list" trigger telling me: "The value you entered isn't valid for this field". Obviously I selected a value that is shown in the (new) list of possible values.
Assumptions:
It looks like as if the combobox is set to a certain data type the first time and that using a different data type leads to the combobox getting confused. This assumption is supported by changing combobox2 to a numeric field in the table and then selecting a low number. Combobox3 reformats the number into a date (which I selected the first time).
Questions:
1) What's going on here with the comboboxes?
2) Is it possible to reset a combobox entirely? The only way to reset the combobox is to close the form and go back into it. I would like to reuse combobox3 for a different datatype without having to close the form first.
I really look forward to your insight.
This looks totally weird to me, so I hope that the forum could shed some light on this mystery. I have three comboboxes:
Combo1: value list (manually filled with selected tablenames)
Combo2: field list (automatically filled with all fields of existing selected table in combo1)
Combo3: table/query (automatically filled with all possible values used in the field of combo2)
All comboboxes have "limit to list" property set to "yes" (I did try limit to list "No", though with the same result).
I select the existing table in combo1 and then select a field from that that has FieldType "date" in combo2. After that I select an existing value from the list in combo3. So far so good...
The issue:
I go back to combo2 and select a different field with datatype "Text". With an combo2_afterupdate I reset the value of combo3 to NULL (me.combo3.value = NULL) and I change the rowsource to the new possible values for the new selected field. To be absolutely sure I requery combo3 (combo3.requery).
Selecting a value (which obviously is a string) results in the "limit to list" trigger telling me: "The value you entered isn't valid for this field". Obviously I selected a value that is shown in the (new) list of possible values.
Assumptions:
It looks like as if the combobox is set to a certain data type the first time and that using a different data type leads to the combobox getting confused. This assumption is supported by changing combobox2 to a numeric field in the table and then selecting a low number. Combobox3 reformats the number into a date (which I selected the first time).
Questions:
1) What's going on here with the comboboxes?
2) Is it possible to reset a combobox entirely? The only way to reset the combobox is to close the form and go back into it. I would like to reuse combobox3 for a different datatype without having to close the form first.
I really look forward to your insight.