Solved

Form datasheet view combo box problem

Posted on 2004-09-02
4
899 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
4 Comments
 
LVL 7

Assisted Solution

by:rockmuncher
rockmuncher earned 50 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 75 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

809 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