?
Solved

Form datasheet view combo box problem

Posted on 2004-09-02
4
Medium Priority
?
910 Views
Last Modified: 2012-08-14
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
0
Comment
Question by:PMahidharia
  • 2
3 Comments
 
LVL 7

Assisted Solution

by:rockmuncher
rockmuncher earned 150 total points
ID: 11970134
This problem occurs if the combo boxes aren't bound to a field in the underlying recordsource of the field.  There is no way to correct this behaviour except by binding the combobox's controlsource to a valid field.

0
 
LVL 7

Expert Comment

by:rockmuncher
ID: 11970141
0
 
LVL 41

Accepted Solution

by:
shanesuebsahakarn earned 225 total points
ID: 11970144
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.
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question