Question : Form datasheet view combo box problem

Hi All.
   I have a form and a subform. The subform is displayed in datasheet view. The subform contains certain combo boxes which derive value from tables, via queries. However, these values are also based on values selected in the preceding combo box i.e. combo box B value is affected by value selected in combo box A, combo box C value affected by value in combo box B, etc. My problem is when I enter a new record, close the form and again open the form, I see that the record is displayed on the subform, but none of the combo box values are displayed. I have a requery macro that runs in the "Got Focus" event of all the combo boxes to requery the combo boxes. So when any combo box gets the focus, it displays the stored record, however, once the focus is lost on the combo box, no value is displayed. I presume, this has nothing to do with the subform or form, but rather is based on the view. I checked out the same thing in the normal "Form" view and all the values are displayed correctly, however, as soon as I switch to "Datasheet" view, this problem happens. I guess Access is getting confused as to which record gets the control. Is there any way to display value in combo boxes in a form's datasheet view? I searched on the Internet and found a similar question at one or two other places, but with no solution.
I would really appreciate any clarification for the above since I am currently developing an important report which will depend on the successful running of this form. Many thanks to all for their time and suggestions in advance.

Cheers:
Prathmesh

Answer : Form datasheet view combo box problem

Essentially, you can't do this in either datasheet view or in a continuous form.

There is only one instance of each control for the whole form, no matter how many records are being displayed. Changing the records that a combo box displays in one record changes them in *all* records. So if a combo box can has the records:
"Red"
"Blue"
"Green"

and it currently shows "Green", when you move to the next record and requery, and the combo box now holds:
"Red"
"Blue"
"Orange"
The value in the previous record disappears because "Green" is no longer in the combo box's list.

Is this form used for data entry? There are *some* tricks you can use to get around this but most of them are unsatisfactory.
Random Solutions  
 
programming4us programming4us